How to Disable AutoRun and AutoPlay on Windows

Prevent USB and removable-drive attacks by disabling AutoRun and AutoPlay, and use Kudu to help harden Windows safely.

By the Kudu Team

Fix this automatically with Kudu

Run a free system scan to detect and resolve this issue automatically — no manual steps required.

Download Kudu Free →

What Causes This?

AutoRun and AutoPlay are Windows features that react when you insert a USB drive, memory card, external hard drive, or other removable media. AutoPlay can automatically open folders or media apps, while AutoRun was originally designed to launch setup files or commands from inserted media. That convenience can also create a security risk, because infected or untrusted devices may trigger unwanted actions, prompts, or software launches.

Common Symptoms

  • A USB drive automatically opens File Explorer, a media app, or an installer
  • Windows asks what to do every time you connect removable media
  • Unknown files, installers, or scripts try to run from a USB device
  • You want to harden a shared or work PC against infected removable drives
  • AutoPlay settings keep causing interruptions when devices are connected

How to Fix It Manually

  1. Turn off AutoPlay in Settings

    • Press Windows + I to open Settings.
    • Click Bluetooth & devices.
    • Select AutoPlay.
    • Turn Use AutoPlay for all media and devices to Off.
    • If you prefer, leave it on and set Removable drive and Memory card to Take no action.
  2. Disable AutoPlay from Control Panel on older systems

    • Press Windows + R, type control, and press Enter.
    • In Control Panel, search for AutoPlay.
    • Click AutoPlay.
    • Uncheck Use AutoPlay for all media and devices.
    • Click Save.
  3. Disable AutoRun with Group Policy Editor
    This option is available on Windows Pro, Enterprise, and Education.

    • Press Windows + R, type gpedit.msc, and press Enter.
    • Go to: Computer Configuration > Administrative Templates > Windows Components > AutoPlay Policies
    • Double-click Turn off AutoPlay.
    • Set it to Enabled.
    • Under Turn off AutoPlay on, choose All drives.
    • Click Apply, then OK.
    • Also open Set the default behavior for AutoRun and set it to Enabled, then choose Do not execute any autorun commands.
  4. Use the Registry if Group Policy is not available
    This is the usual method on Windows Home. Be careful when editing the registry.

    • Press Windows + R, type regedit, and press Enter.
    • Navigate to: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer
    • If NoDriveTypeAutoRun does not exist, right-click the right pane, choose New > DWORD (32-bit) Value, and name it NoDriveTypeAutoRun.
    • Double-click it and set the value to 255 (decimal) or FF (hexadecimal) to disable AutoRun on all drive types.
    • Click OK and close Registry Editor.
  5. Restart Windows

    • Save your work and restart your PC.
    • After rebooting, insert a USB drive and confirm that nothing launches automatically.
  6. Check removable-drive behavior

    • Open File Explorer manually and browse the USB drive yourself.
    • If the device contains suspicious files like unexpected .exe, .bat, or shortcut files, do not open them.
    • Run a security scan before using files from unknown media.

Fix It Automatically with Kudu

Kudu can check Windows security and convenience settings like AutoPlay-related hardening options, then apply safer defaults without digging through Group Policy or the registry yourself. It’s a faster way to lock down removable-drive behavior and reduce the risk of USB-based malware or nuisance prompts.

Download Kudu Free →

Fix this automatically with Kudu

Run a free system scan to detect and resolve this issue automatically — no manual steps required.

Download Kudu Free →