When you insert a drive into a Windows, by default it’s gonna’ likely mount the drive (and run the autorun.inf if there is one or AutoPlay to play the music if it’s an audio disc). When you insert a disk or drive into a Windows computer you can hold down the Shift key and it will disable the auto-run and AutoPlay functionality of the system. But you can also control that functionality at a pretty granular level. The most common way to do so is likely using the Global Policy Editor. To do so, open gpedit.msc, click on Computer Configuration and then Administrative Templates, then System and select the option for Turn Off Autoplay. Here you will be able to set it to All or select some specific devices to disable the Autoplay functionality for.
You can also configure Autoplay from the registry (and therefore push it out easily with login scripts if you don’t have Active Directory (eg – Open Directory PDC environments). The key to change is NoDriveTypeAutoRun and it is actually located in two places:
- HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer
- HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionpoliciesExplorer
The value of this key will be set as follows according to the type of drive/disk/disc/volume you’d like to disable the AutoPlay feature for:
- 0x1 – Drives of unknown type
- 0x4 – Removable drives
- 0x8 – Fixed drives
- 0x10 – network drives
- 0x20 – CD-ROM drives
- 0x40 – RAM disks
- 0x80 – Drives of unknown type
- 0xFF – Disables AutoPlay on all kinds of drives
Once reconfigured you’ll need to reboot. Also, make sure you have all the latest patches installed as there were problems with Auto-Run and AutoPlay settings at some point in the past. There are specific patches if these persist, according to your version:
- Windows 2000
- Windows XP
- Server 2003
- N/A for Vista and 2008