enable or disable automatically
1. Click Start, click Run, type regedit in the Open box, and then press ENTER.
2. Locate and click the following registry key:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\CDRom
3. To disable automatically running CD-ROMs, change the Autorun value to 0 (zero). To enable automatically running CD-ROMs, change the Autorun value to 1.
4. Restart your computer.
Additional Information
There are two other registry keys that can affect this functionality:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
NoDriveTypeAutoRun = 0x00000095
-and-
HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
NoDriveTypeAutoRun = 0x00000095
The correct value for each is 0x00000095.
Ref. Microsoft Support