We have blogged about a detailed tutorial in past which teaches you how to disable Autorun functionality in Windows:
It requires some registry skills. Once again our regular reader "Masroor Aijaz aka JX Great" has created another excellent tool called "AutoRun Disabler" which allows you to disable Autorun functionality for different kind of drives like CD drive, removable drives, etc quickly and easily.
Its a portable utility so you don't need to install it. Simply download the ZIP file, extract it and run the EXE file. Select the desired option from the list and click on OK button to apply it.
You'll need Microsoft .NET Framework 3.5 or higher to use this tool.
NOTE: Some new and not very popular security software might show malware warning message when you try to download or run this software. Please ignore the message, its a false positive. Since this tool tries to modify Windows Registry, the security software incorrectly detects it as suspicious item. The software is absolutely safe to use.