Disable Removable Media Autorun via Regedit
Disabling the automatic execution of autorun scripts on removable media is a critical security measure to prevent malware infections from USB drives and external disks. This guide provides a step-by-step walkthrough on how to use the Windows Registry Editor (Regedit) to completely turn off the AutoRun and AutoPlay features across your system.
Step 1: Open the Registry Editor
- Press
Win + Ron your keyboard to open the Run dialog box. - Type
regeditand press Enter or click OK. - If prompted by User Account Control (UAC), click Yes to grant administrative privileges.
Step 2: Navigate to the Explorer Policies Key
You can disable AutoRun for the current user or globally for all users on the machine.
For the Current User: Navigate to:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\ExplorerFor All Users (System-wide): Navigate to:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
(If the Explorer key does not exist under
Policies, right-click on Policies, select
New > Key, and name it
Explorer.)
Step 3:
Create or Modify the NoDriveTypeAutoRun Value
- With the
Explorerfolder selected in the left pane, look for a DWORD value namedNoDriveTypeAutoRunin the right pane. - If it does not exist:
- Right-click an empty space in the right pane.
- Select New > DWORD (32-bit) Value.
- Name the value
NoDriveTypeAutoRun.
- Double-click
NoDriveTypeAutoRunto edit its properties. - Set the Base to Hexadecimal.
- Change the Value data to
FF(or select Decimal and enter255).- The value
FF(255) disables AutoRun on all types of drives, including removable drives, fixed drives, CD-ROMs, and network drives.
- The value
- Click OK to save the changes.
Step 4: Enforce the AutoRun Policy
To ensure Windows strictly adheres to this registry policy:
- Navigate to:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer - Right-click an empty space in the right pane and choose New > DWORD (32-bit) Value.
- Name it
HonorAutorunSetting. - Double-click
HonorAutorunSetting, set the Value data to1, and click OK.
Step 5: Apply the Changes
Restart your computer or sign out and back into your Windows account for the changes to take full effect. Once applied, Windows will no longer automatically execute scripts or applications when removable media is connected.