This article provides information on enabling and disabling Autoplay in CD/DVD drives for Windows 7 and 8
AutoPlay (also known as AutoRun) is a feature that automatically runs a program or opens a file on a removable drive or CD/DVD after connecting/inserting it. Most automation tasks are specified in a file named autorun.inf. AutoPlay is a convenient feature, but it also means that viruses and malware make heavy use of such automation by launching or installing programs without you ever noticing it. That's why most security-aware people tend to disable it completely.
To configure AutoPlay in Windows Vista or 7, open Start menu by clicking Start button or pressing Windows Key on your keyboard. Type "autoplay" in Search box and click Autoplay.
In Windows 8, open Settings search using keyboard shortcut Windows Key+W, type "autoplay" in Search box and click AutoPlay.
In Windows 8.1, there are both the traditional Control Panel version (click the more colorful AutoPlay for this) and a simplified Modern UI app (click AutoPlay settings, or any other item with cogwheel icon) available.
The new Windows 8.1 Modern UI PC Settings app only allows turning AutoPlay completely off with the Use AutoPlay for all media and devices slider; or selecting actions for removable drives and memory cards. Please note that Windows Explorer has been renamed to File Explorer since Windows 8.
The Control Panel configuration for AutoRun look almost the same since Windows Vista, except that Windows 8 and 8.1 group items by device type and have two additional sections: Removable drive and Memory card.
To disable AutoPlay/AutoRun completely in Windows Vista, 7, 8 and 8.1, clear the Use AutoPlay for all media and devices check box. Click Save to close the window.
If you do not want to be that restrictive about automatic actions, use the following configuration instead. First, make sure the Use AutoPlay for all media and devices check box is turned on.
Then select Take no action for the following items:
Blank CD
Blank DVD
Blank BD
This disables AutoPlay popups in case you insert a blank disc or connect an external or removable device such as USB flash drives or external hard drives with some of the listed content on them.
Here's an example of non-restrictive, but still secure AutoPlay configuration in Windows 7:
There are also AutoPlay actions available for several types of devices - digital photo and video cameras, smartphones, etc. You should set these to Take no action or to view device contents with Windows/File Explorer. Click Save to apply changes.