Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to close XP AutoPlay Dialog

How to close XP AutoPlay Dialog

Scheduled Pinned Locked Moved C#
csharpadobetutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Barry Etter
    wrote on last edited by
    #1

    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

    H 1 Reply Last reply
    0
    • B 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

      H Offline
      H Offline
      Hessam Jalali
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups