How To Disable It
First, make sure your system is up to date on system updates and security patches.
For Windows 2000, XP Pro, and Windows Server 2003
1. Start-->Run, type gpedit.msc in the Open box and click OK.
2. Below Computer Configuration double-click Administrative Templates, double-click System.
3. In the right-hand pane, find Turn off Autoplay (or Disable Autoplay) and double-click it.
4. Click the Enabled radio button, then select All Drives in the pull-down box. Click OK.
5. Exit the Group Policy editor and restart the computer.
For Windows Vista and Windows Server 2008
1. Click Start and type gpedit.msc in the Start Search box, and press ENTER. If you are prompted for an administrator password, enter it.
2. Below Computer Configuration, double-click Administrative Templates, double-click Windows Components, and click Autoplay Policies.
3. Find Turn off Autoplay in Details and double-click it.
4. Click Enabled, select All drives in the pull-down box.
5. Close the Group Policy editor and restart the computer.
For operating system versions without the Group Policy Editor
1. Back up the registry.
2. Start-->Run, type regedit in the Open box and click OK.
3. Find the following registry entry and click it:
4. Right-click NoDriveTypeAutorun and click Modify.
5. In the Value box, type 0xFF, click OK, and exit the Registry Editor
6. Restart the computer.
For more information see this Microsoft support article.