I had my code to check for installation program on pc and I had window for user to setup this program if it did not setup in his PC. I add my code and it worked well but I want to add cd drive or dvd driver as a path to filename property as I will make autorun CD for more user and these user of course have different cd drive names. So please how can I do that?
note: that I named my cd with Adobe
private void OK_Click_1(object sender, EventArgs e)
{
Process myProcess = new Process();
myProcess.StartInfo.FileName = "Cd driver path";
myProcess.Start()开发者_StackOverflow社区;
}
You need to detect the CD/DVD-drive.
See http://www.dreamincode.net/code/snippet1575.htm on how to query WMI for available devices.
I have made a program that does this every 20 seconds running on over 400 computers for over a year, so I can recommend using this technique (it is stable).
精彩评论