Now-a-days most of the viruses that affect our computer come from pen drive. Unknowingly most of us use our pen drives as a virus carrier. And most of this viruses are activated when we "auto-play" them. By turning off "auto-play" option we can reduce the spread of virus in our computer.
A way to disable the "auto-play" option is given below:
-Go to start> run> type gpedit.msc
-Now from Computer configuration click administrative templates> system
-There at the right pane look for "turn off autoplay".
-See that it's set as not configured.
-Select enabled and then select 'all drives'.
*Not applicable for all the versions of Windows.