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

  1. Press Win + R on your keyboard to open the Run dialog box.
  2. Type regedit and press Enter or click OK.
  3. 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.

(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

  1. With the Explorer folder selected in the left pane, look for a DWORD value named NoDriveTypeAutoRun in the right pane.
  2. If it does not exist:
    • Right-click an empty space in the right pane.
    • Select New > DWORD (32-bit) Value.
    • Name the value NoDriveTypeAutoRun.
  3. Double-click NoDriveTypeAutoRun to edit its properties.
  4. Set the Base to Hexadecimal.
  5. Change the Value data to FF (or select Decimal and enter 255).
    • The value FF (255) disables AutoRun on all types of drives, including removable drives, fixed drives, CD-ROMs, and network drives.
  6. Click OK to save the changes.

Step 4: Enforce the AutoRun Policy

To ensure Windows strictly adheres to this registry policy:

  1. Navigate to: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer
  2. Right-click an empty space in the right pane and choose New > DWORD (32-bit) Value.
  3. Name it HonorAutorunSetting.
  4. Double-click HonorAutorunSetting, set the Value data to 1, 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.