Autoplay is a serious risk to your Windows security. In fact, most malware comes that way.
So it’s better to disable it completely.
Your first guess would be going to Control Panel -> All Control Panel Items -> AutoPlay and unticking Use autoplay for all media and devices.
Well, that does nothing. The proper way is to start up gpedit.msc from the Run command in the Start Menu. Then browse to Computer Configuration > Administrative Templates > Windows Components . Look for Turn off Autoplay option, right-click it and choose Edit, change the setting to Enabled and click Apply. Yes, that’s tricky: to have autoplay disabled, you have to get Turn Off Autoplay enabled.
Apparently, having logical Autoplay On/Off trigger would be most unorthodox!
The last step here is to select All drives from Turn off Autoplay drop-down list to disable it on all drives.
Unfortunately, you can do all the above only on Windows 7 Professional or higher. Starter and Home editions don’t have Group Policy Editor (gpedit.msc) and no other way to disable autoplay. Even if you use add_gpedit_msc installer available here, the needed policy is just not on your system.
The only option you have is to disable Shell Hardware Autodetection Service in Control Panel -> Administrative tools -> Services.
That will somewhat disable the feature, but not completely.