How to close XP AutoPlay Dialog
-
I have a C# service that communicates to a USB flash drive. Since my program is smart enough to know when the drive is plugged in and when it's not, I don't need to have XP open the "Autorun" dialog window asking me what application to run when the drive is plugged in. Can I somehow kill this window from my C# app? I would like to do it this way because if my application is NOT running, I DO want the XP autorun dialog to display giving users the option to install the application. Any advice would be appreciated! Thanks, Barry
Barry Etter
-
I have a C# service that communicates to a USB flash drive. Since my program is smart enough to know when the drive is plugged in and when it's not, I don't need to have XP open the "Autorun" dialog window asking me what application to run when the drive is plugged in. Can I somehow kill this window from my C# app? I would like to do it this way because if my application is NOT running, I DO want the XP autorun dialog to display giving users the option to install the application. Any advice would be appreciated! Thanks, Barry
Barry Etter
You can disable it through registry
const int DISABLEALL = 0xff; const int DISABLEALLEXECPTCDROMS = 0xdd; const int DISABLECDROM = 0xb1; RegistryKey key = Registry.CurrentUser.OpenSubKey("Software").OpenSubKey("Microsoft").OpenSubKey("Windows").OpenSubKey("CurrentVersion").OpenSubKey("Policies").OpenSubKey("Explorer", true); key.SetValue("NoDriveTypeAutoRun", DISABLEALLEXECPTCDROMS); }
code for disable AutoRun for all devices is 0xff and disable AutoRun for all devices except CD-Roms is 0xdd disable just for CD-Roms is 0xb1 and the changes would be applied after restart Good Luck