Go to Start and Run, type in gpedit.msc and press enter. After you are there go to ComputerConfiguration > Administrative Templates > System. Under the System level, you will see an option as Turn off Autoplay. Enable it.
------------------------------------------------------------------------------------------------------------------------
Default Behavior of Autorun and AutoPlay
Default behavior of AutoPlay on Windows XP-based systems
AutoPlay begins reading from a drive as soon as you insert media into the drive. Therefore, the Setup file of programs and the music on audio media start immediately. Before Windows XP SP2, AutoPlay was disabled by default on removable drives, such as the floppy disk drive (but not the CD drive), and on network drives. Starting with Windows XP SP2, AutoPlay is enabled for removable drives. This includes ZIP drives and some USB mass storage devices. If you enable the settings to disable AutoPlay (the procedure to do this is described in this article), you can disable AutoPlay on a CD drive, on removable media drives, on all drives.
Note This setting appears in both the Computer Configuration and User Configuration folders. If the settings conflict, the setting in Computer Configuration takes precedence over the setting in User Configuration.
Default behavior for Autorun
Autorun commands are generally stored in Autorun.inf files. These commands enable applications to start, start installation programs, or start other routines. In versions of Windows that are earlier than Windows Vista, when media that contains an Autorun command is inserted, the system automatically executes the program without requiring user intervention. Because code may be executed without user's knowledge or consent, users may want to disable this feature because of security concerns. The configuration settings that are described in this article give Administrators the ability to selectively or completely disable all Autorun capabilities for systems that run Windows 2000, Windows XP, Windows Server 2003, Windows Vista, and Windows Server 2008 systems.
The default behavior in Windows Vista and Windows Server 2008 is to prompt the user whether an Autorun command is to be run. Changes to these settings are described later in this article. An Administrator can completely disable Autoruncommands or revert to the pre-Windows Vista behavior of automatically executing the Autorun command. If the feature is configured to disable Autorun capabilities, or if this policy is not configured, Windows Vista and Windows Server 2008 will continue to prompt the user whether the Autorun command is to be run.
Prerequisites to disable Autorun capabilities
To disable Autorun capabilities, you must install the following updates:
Update for Windows XP (KB967715)
http://www.microsoft.com/downloads/details.aspx?FamilyID=c7dbcde3-7814-47c5-849e-e64ecfb35d74
Update for Windows Server 2003 for Itanium-based Systems (KB967715)
http://www.microsoft.com/downloads/details.aspx?FamilyID=99423caf-b52b-4ebc-b80c-94ee1ef9f66b
Update for Windows Server 2003 x64 Edition (KB967715)
http://www.microsoft.com/downloads/details.aspx?FamilyID=7b866fb7-9bb7-4fce-b395-d0a4ee38a115
Update for Windows Server 2003 (KB967715)
http://www.microsoft.com/downloads/details.aspx?FamilyID=32b845ac-7681-468c-812b-2dcebdae9b40
Update for Windows XP x64 Edition (KB967715)
http://www.microsoft.com/downloads/details.aspx?FamilyID=ca802f38-0566-4ac4-8808-6515623c35c5
Update for Windows 2000 (KB967715)
http://www.microsoft.com/downloads/details.aspx?FamilyID=3c6039f1-d84d-4294-8457-35aa8b4dcab8
Windows Vista-based and Windows Server 2008-based systems must have update 950582 (Security bulletin
MS08-038) installed to take advantage of the registry key settings that disable Autorun.