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
-
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.
-
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.
- Press Windows + R, type
-
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.
- Press Windows + R, type
-
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) orFF(hexadecimal) to disable AutoRun on all drive types. - Click OK and close Registry Editor.
- Press Windows + R, type
-
Restart Windows
- Save your work and restart your PC.
- After rebooting, insert a USB drive and confirm that nothing launches automatically.
-
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.
Fix this automatically with Kudu
Run a free system scan to detect and resolve this issue automatically — no manual steps required.
Download Kudu Free →Related guides
How to Disable SMB1 Protocol on Windows
Disable legacy SMB1 to reduce exposure to wormable network attacks, and use Kudu to help audit old Windows features.
How to Disable Telnet and Legacy Network Services on Windows
Remove outdated network features that expand attack surface, and use Kudu to help identify legacy services to disable.
How to Disable Windows Script Host to Stop Script-Based Malware
Disabling WSH can block VBS and JS malware on systems that do not need it, and Kudu can help review safe hardening steps.
How to Disable Remote Assistance on Windows If You Never Use It
Turn off Remote Assistance to reduce unnecessary remote access features, and use Kudu to help harden Windows safely.