Turn off AutoPlay for USB drives in Windows

A USB drive can trigger an AutoPlay prompt when it is connected. Turn off Autoplay controls this behavior. If a connected drive shows no prompt, this policy is one possible restriction; services, notifications, and default actions can also matter.

Problems this policy can address

To suppress that prompt for selected drive types, use this policy; choose Computer Configuration to apply it across users.

The policy applies to CD-ROM and removable media drives or to all drives. When Disabled or Not Configured, the policy allows AutoPlay, but it cannot turn AutoPlay on for drives where it is already disabled by default. Other settings and services can still affect the result. Computer configuration takes precedence if the computer and user policies conflict. A managed PC may require help from its administrator.

Steps

  1. Open the Local Group Policy Editor with gpedit.msc.
  2. Under Computer Configuration or User Configuration, navigate to Computer Configuration › Administrative Templates › Windows Components › AutoPlay Policies and open Turn off Autoplay.
  3. Record the original policy state and, if enabled, the drive-type selection. Select Enabled, choose CD-ROM and removable media drives or all drives, and apply the setting.
  4. To undo the change, restore the original policy state and, if it was enabled, its original drive-type selection. If it was not configured, select Not Configured.

The policy takes precedence over AutoPlay settings in Settings or Control Panel, although their controls may remain visible. It does not cover MTP non-volume devices or the default behavior of AutoRun commands; those have separate policies.

Registry settings

The corresponding registry value is NoDriveTypeAutoRun (REG_DWORD) under HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer or HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer. Enabled with CD-ROM and removable media uses 181 (0xB5); all drives uses 255 (0xFF). Computer and user scopes are separate. Before editing, export the key and record whether the value existed and its previous data. Registry data for disabled or not configured and a specific recovery procedure are not confirmed, so restore the original policy state in the editor.

Baseline: Windows 11 version 26H2 policy templates (checked 2026-11-04).

References