Disable Windows Autorun Any Drives

Environment
  • Microsoft Windows XP
Introduction
Nowadays, many viruses go to attack via autorun, therefore, disable it

Solutions
Edit registy - HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\policies\Explorer
  • Add a value:NoDriveTypeAutoRun
  • Data type: REG_DWORD
  • Value: 0xff hex (or 255 decimal)
Code
REM Force to set to disable drive auto run

%windir%\system32\reg.exe add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer /v NoDriveTypeAutoRun /t REG_DWORD /d 0xff /f
Reference
  • http://support.microsoft.com/kb/967715/