Home/Disable autorun for USB drives
How to Disable Autorun for USB Drives: Step-by-Step Guide 2026
A USB stick that launches something the moment it is plugged in is the oldest trick in the removable-media playbook. This guide covers Windows 11 and Windows 10 and shows how to switch the behaviour off with the Settings toggle, Group Policy or two registry values. Windows 7 and later already ignore autorun commands on USB drives, so the real work is turning off AutoPlay and closing the gaps that remain.
To disable autorun for USB drives on Windows 11, open Settings, choose Bluetooth & devices, select AutoPlay and turn off Use AutoPlay for all media and devices. To cover every account on the PC, an administrator can enable the Group Policy Turn off AutoPlay for all drives or set the registry value NoDriveTypeAutoRun to 0xFF.
At a glance
| Applies to | Windows 11 and Windows 10, all editions |
|---|---|
| Time needed | 2 minutes for Settings, about 10 for Group Policy |
| Difficulty | Easy for Settings, moderate for policy and registry |
| Cost | Free for every built-in method |
| Needs | Administrator account for policy and registry changes |
| Last verified | November 2026 |
How to Disable Autorun for USB Drives: Quick Answer
Disabling autorun for USB drives involves two separate switches. AutoPlay, the pop-up that appears when a drive is plugged in, is turned off in Settings or Group Policy. Autorun, the autorun.inf file a drive carries, is already ignored for USB media on Windows 7 and later, and two registry values lock that behaviour down further.
If you only need the pop-up gone
Use the Settings toggle. It takes one minute, needs no administrator rights on most home PCs and affects only the account you are signed in to. Set the removable drive default to Take no action if you would rather keep AutoPlay for cameras and switch it off for flash drives.
If several people share the PC
Use Group Policy on Windows Pro, Enterprise or Education, or the registry value on Windows Home. Both are machine-wide and survive another user flipping the Settings toggle back on. Microsoft documents that the policy does not lock the Settings page itself, so check both places.
Pick your path
Choose what you need help with and the page jumps to the right section.
What You Need Before You Start Disabling Autorun
Before changing anything, check your Windows edition under Settings, System, About, because the Local Group Policy Editor ships only with Pro, Enterprise and Education. Plan on an administrator account for policy and registry changes, about ten minutes, and an exported registry key so any change can be reversed in one step.
Windows edition
Home has the Settings toggle and the registry. Pro, Enterprise and Education add gpedit.msc. Windows 10 reached end of support on October 14, 2025, so apply the steps there knowing it no longer receives security updates.
Administrator rights
The Settings toggle changes your own account. Group Policy and the HKEY_LOCAL_MACHINE registry key change the whole PC and need an administrator prompt.
Ten minutes and a backup
Export the Explorer policy key first. If the key does not exist yet on a fresh PC, there is nothing to back up and you can continue.
Admin rights and a rollback plan
Open an administrator Command Prompt and run the export below. It writes a .reg file you can double-click later to restore the previous values. For a full-PC safety net, create a restore point from System Properties first.
reg export "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" "%USERPROFILE%\Desktop\explorer-policies-backup.reg"Step-by-Step: Disable Autorun for USB Drives
The Settings method takes under a minute: open Settings, choose Bluetooth & devices, select AutoPlay and switch off Use AutoPlay for all media and devices. That change covers your account only. Group Policy and the registry cover the whole PC, and both are explained below with their edition limits.
Method 1: Turn off AutoPlay in Windows Settings
- Open SettingsPress Win + I.
- Go to AutoPlaySelect Bluetooth & devices, scroll down and choose AutoPlay.
- Switch the master toggle offTurn off Use AutoPlay for all media and devices. Windows then stops reacting when you plug in a drive.
- Or keep AutoPlay and pick a safe defaultLeave the toggle on, open the Removable drive list and choose Take no action. Memory cards can keep a different default.
- Test with a clean drivePlug in a drive you trust. No window or prompt should appear, and the drive stays reachable from File Explorer.
Windows 10 users can reach the same options from Control Panel, under the AutoPlay item, and Windows Report documents the same four default actions for each device type: take no action, open folder, ask every time or configure storage settings.
Pros
- No admin rights on most home PCs
- Reversible in seconds
Cons
- Per account, so other users keep their own setting
- Not a security control a user cannot undo
Method 2: Turn off AutoPlay and autorun with Group Policy
- Open the Local Group Policy EditorPress Win + R, type
gpedit.mscand press Enter. - Browse to the policy folderComputer Configuration, Administrative Templates, Windows Components, AutoPlay Policies.
- Enable Turn off AutoPlayDouble-click it, select Enabled, and in the Turn off AutoPlay on list choose All drives. Windows writes 0xFF to the registry for this choice.
- Enable Set the default behavior for AutoRunSelect Enabled and choose Do not execute any autorun commands. This is the value the DISA Windows 11 STIG checks as finding WN11-CC-000185.
- Apply and sign outRun
gpupdate /forcein an administrator Command Prompt, or sign out and back in.
Choose the list item CD-ROM and removable media drives only if you must keep AutoPlay on other drive types. Microsoft documents that this choice writes 0xB5 instead of 0xFF.
Method 3: Set the two registry values
The same two settings live in the registry, which is the route for Windows Home. NoDriveTypeAutoRun is a bit field of drive types, and 0xFF switches off AutoPlay for all of them. NoAutorun set to 1 stops autorun commands from running at all. Restart Explorer or sign out afterwards, because Microsoft's documentation says Explorer reads the value at start.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"NoDriveTypeAutoRun"=dword:000000ff
"NoAutorun"=dword:00000001The per-user variant, the undo file and a PowerShell version are in the full walkthrough for turning off AutoRun in Windows Home with the registry.
Windows edition note: Home versus Pro
Windows Home does not include the Local Group Policy Editor, and typing gpedit.msc returns a not found error. Microsoft's Q&A answers and NinjaOne both state it is limited to Pro, Enterprise and Education. Home users have two honest options: the registry values above, or an upgrade to Pro.
Method picker: which route fits your PC?
Answer three questions and the recommended method appears below. Nothing is sent anywhere.
Use Method 1, then Method 3. The Settings toggle stops the pop-up now, and the registry values make it stick for every account on the PC.
Built-in Windows Methods Compared
Eight controls cover USB autorun in Windows, from a one-click toggle to a Defender rule that blocks unsigned programs launched from a drive. They differ in scope and in what they actually stop, and only some of them keep a log. The table sets each method beside the others with its honest limit.
| Method | Difficulty | Security effect | Cost | Best for | Limitations |
|---|---|---|---|---|---|
| Settings toggle | Easy | Stops the pop-up for one account | Free | Home PCs with one user | A user can switch it back on |
| Group Policy: Turn off AutoPlay | Moderate | Writes 0xFF for all drives | Free | Pro, Enterprise and Education | Does not lock the Settings toggle |
| Group Policy: Set the default behavior for AutoRun | Moderate | Blocks autorun commands (NoAutorun = 1) | Free | Compliance baselines | Needs the policy editor |
| Registry: NoDriveTypeAutoRun | Moderate | Same effect as the policy | Free | Windows Home and scripts | Typing errors, Explorer restart needed |
| Removable Storage Access policy | Moderate | Denies read, write or execute on storage | Free | Locked-down kiosks | Restart needed; blocks every storage drive |
| Defender rule: untrusted processes from USB | Advanced | Stops unsigned programs running from USB | Free with Defender | Managed fleets | Needs Defender Antivirus as the active scanner |
| USBSTOR Start = 4 | Moderate | Stops the storage driver loading | Free | Emergency lockdown | Blunt: no allow-list and no log |
| Dedicated blocking software | Moderate | Blocks storage with an allow-list and log | Paid | Shared and office PCs | Does not replace antivirus |
| Our verdict | Use Group Policy or the registry for autorun, add the Defender rule for execution, add a block for unknown drives | No single row covers all three risks |
Group Policy vs registry vs software-based control
Group Policy and the registry write the same values, so choose by tooling: policy for managed fleets, registry for Home and scripts. Software-based control works on a different layer. It decides whether a storage drive mounts at all, which no autorun value can do.
Best Free Methods to Disable Autorun for USB Drives
Three free methods cover most readers: the Settings toggle for a personal PC, Group Policy for a Pro machine that several people use, and the registry for Windows Home. All three cost nothing and take under ten minutes, and each can be reversed without reinstalling anything.
Free and enough for
- Stopping the AutoPlay prompt
- Blocking autorun commands by policy
- Checking your settings with PowerShell
Free but not enough for
- Stopping a stranger's drive from mounting
- Logging who plugged in what
- Blocking keyboard-emulating devices
How Autorun Malware Spreads From USB Drives
Autorun malware spreads when Windows runs a program named in a drive's autorun.inf file without asking. Microsoft changed Windows 7 so that AutoPlay stopped offering autorun tasks for non-optical media, then backported that to XP and Vista as update KB971029. Current USB threats lean on other tricks.
The classic worm planted an autorun.inf on every drive it touched, so each plug-in infected the next PC. After Microsoft's change, the same code often fell back on disguised shortcuts: the worm hides your folders and leaves lookalike shortcut files that launch it when you double-click. Our walkthrough of recovering a drive whose files turned into shortcuts covers that case step by step.
Removable media remain a favoured carrier because they cross network boundaries by hand. A reference page on removable media as a malware carrier notes that infections still occur when people open infected files, even though autorun has been off by default for years.
USB Device Classes: What Each Setting Touches
USB devices announce a class when they connect: mass storage for drives, human interface device for keyboards and mice, and others for printers and hubs. Autorun settings affect only the prompt for storage, and a storage block affects only storage. Knowing the class tells you what a given setting will leave alone.
| Device class | Examples | Autorun and AutoPlay off | Storage block | Note |
|---|---|---|---|---|
| Mass storage | Flash drives, external disks, SD card readers | Stops the prompt only | Blocked or allow-listed | The main target |
| Keyboard and mouse (HID) | Wired and wireless dongles | Not affected | Not affected by a storage rule | Keep these working |
| Phones and cameras | Android, iPhone, camera in file-transfer mode | Stops the prompt only | Blocked when they mount as drives | Charging usually continues |
| Printers and scanners | USB printers | Not affected | Not affected by a storage rule | Check before a controller block |
| Hubs and docks | USB hubs, laptop docks | Not affected | Not affected | A hub can carry storage behind it |
Allow keyboard and mouse while blocking storage
A storage block leaves keyboards and mice working, because they use the human interface class that the Removable Storage Access policy does not touch. The exception is blocking at the USB controller or BIOS level, which removes every device on the port. That is why a class-based block is the better fit for a PC you still need to type on.
Policy Rollout Checklist for Offices With Several PCs
Rolling the setting out to many PCs works best in four moves: record the current values, test on two or three machines, deploy by policy, then confirm each PC with the same check. Doing it in that order means a mistake costs two PCs, not forty.
Rollout checklist
0 of 7 completed
Office USB policy generator
Choose the scope and drive types, then copy the registry file.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"NoDriveTypeAutoRun"=dword:000000ff
"NoAutorun"=dword:00000001Run from an administrator account; applies to every user on the PC. 0xFF covers every drive type. NoAutorun=1 also stops autorun.inf commands.
Troubleshooting: When Autorun Settings Will Not Stick
Most failed attempts trace back to three causes: the change was made for the wrong account, Windows Home lacks the policy editor, or Explorer has not yet re-read the value. The table maps seven symptoms to the cause and the fix, with a link when another guide owns the full answer.
| Problem | Likely cause | Fix |
|---|---|---|
| AutoPlay still pops up after the Settings toggle is off | Another account, or a policy overriding the page | Check each account, then read the registry value. See the verify section below. |
| Policy is on but the Settings page still shows the toggle | Microsoft notes the policy does not lock the page | Ignore the toggle and verify the registry value NoDriveTypeAutoRun. |
| gpedit.msc says Windows cannot find the file | Windows Home has no Local Group Policy Editor | Use the registry method for Home or upgrade to Pro. |
| Registry change seems to do nothing | Explorer has not re-read the value | Sign out and back in, or restart Explorer, then test again. |
| Folders on the drive became shortcuts | Shortcut malware hid the originals | Follow the shortcut recovery steps; autorun settings do not fix it. |
| Removable Storage policy has no effect | Access rights apply after a restart | Restart the PC, or set the force-reboot time in the same policy folder. |
| Laptop media buttons stopped working | Microsoft documents that turning AutoPlay off for all drives can break some HotStart buttons | Switch the list item to CD-ROM and removable media drives. |
How to Verify It Worked After You Disable Autorun for USB Drives
Verification takes two checks: read the registry values and plug in a drive you trust. NoDriveTypeAutoRun should read 255 and NoAutorun should read 1 if you set both. A clean test drive should open nothing by itself, and its files should appear only when you open it in File Explorer.
Confirmation steps
0 of 6 completed
# Read the machine-wide values (blank means the value is not set)
Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' | Select-Object NoDriveTypeAutoRun, NoAutorun
# Read the current user's value
Get-ItemProperty -Path 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' | Select-Object NoDriveTypeAutoRunCommon Mistakes When You Disable Autorun for USB Drives
Four mistakes account for most disappointing results: setting only the current user, picking a narrow bit mask, trusting the Settings page after a policy change, and assuming autorun settings stop malware you open yourself. Each has a quick correction in the pairs below.
Not that
- Setting 0x04 and assuming external disks are covered
- Checking only the Settings page after applying policy
- Editing the registry without an export first
- Treating autorun off as a malware scanner
Do this
- Use 0xFF so every drive type is included
- Read the registry value to confirm the result
- Run the export command and keep the .reg file
- Keep Defender on and scan unknown drives
Is This Enough? What Else to Do After You Disable Autorun for USB Drives
Turning autorun off stops one launch path, which leaves two others open. Our named rule, Prompt, Process, Port, splits the defence into three jobs: switch off the prompt, restrict what processes may run from a drive, and control which drives may connect at all. Each layer covers a gap the others leave.
| Layer | Job | Free tool |
|---|---|---|
| Prompt | No automatic action on insert | AutoPlay off, NoDriveTypeAutoRun |
| Process | Stop unsigned programs from a drive | Defender USB rule, antivirus |
| Port | Control which drives connect | Removable Storage policy |
Risk score card: is your PC exposed through USB?
Five quick questions. The score is calculated in your browser and stored nowhere.
Low exposure (0 of 10). Your USB habits carry little risk. Keep autorun off and review again after big Windows updates.
Why Block USB Ports at All
Blocking USB storage addresses a different risk from autorun: data leaving the building and unknown drives entering it. A single copied customer list or one infected stick found in a car park can cost more than any licence. Schools, kiosks and shared offices block storage for those reasons.
Data walking out
A 64 GB stick holds a whole shared drive. Without a block or a log, nobody can say who copied what.
Unknown drives coming in
Dropped or gifted sticks are a known delivery route. Blocking by default turns each plug-in into a decision.
Shared and public PCs
Kiosks, classrooms and reception desks rarely need storage at all, so a block costs nothing in convenience.
A Microsoft Q&A thread on whether a USB port can be password-protected makes a useful point: the port itself cannot hold a password, so any password prompt has to come from software that sits between the drive and the PC. Microsoft's own security baselines also favour controlling removable storage by policy.
Use these controls only on devices you own or administer. Monitoring or blocking other people's personal machines without their knowledge is outside what this guide covers, and in many places it is unlawful.
For deeper background on the managed-PC side, NinjaOne's overview explains four ways to disable USB drives through the registry, Group Policy and Device Manager.
Our Top Recommendation When Settings Are Not Enough
When the real worry is unknown drives rather than a pop-up, a storage block does a job autorun settings cannot. USB Block from NewSoftwares.net blocks USB storage on a Windows PC behind a password and records connection attempts. It does not scan files, so it complements antivirus and does not replace it.
What it does and what it does not
- Blocks USB storage devices from being used on a PC, behind a password you set
- Keeps a log of connection attempts that an administrator can review
- Leaves keyboards and mice alone, because it targets storage
- Is not antivirus and does not mention autorun control on its product page
The honest summary: autorun settings decide what Windows does when a drive appears, and a storage block decides whether the drive may appear at all. Used together they cover the prompt and the port. See the product page for current features, system requirements and pricing before you buy.

Software-Based USB Blocking Step-by-Step
Setting up a software block takes five steps and about ten minutes: install as an administrator, set a password, switch on storage protection, test with a spare drive and read the log. The password matters most, because anyone who knows it can turn protection off again.
- Download and installDownload the installer from the product page and run it as an administrator.
- Set a passwordChoose a password you will not forget. It protects the settings from anyone else on the PC.
- Turn on USB storage protectionUse the protection switches to block USB storage devices.
- Test with a spare drivePlug in a drive. It should not mount, and the attempt should appear in the log.
- Review the logOpen the access log tab and clear it only after you have read it.

How to Allow Approved Drives Only
An allow-list flips the default from open to closed: every removable drive is denied unless its identity is on an approved list. Windows can build one with device-ID policies, and some tools add a friendlier interface. Either way, the list is only as good as the effort spent keeping it current.
Open Device Manager, find the approved drive, and copy its hardware ID or device instance ID from the Details tab. Add that ID to the allow policy, restart, then test with the approved drive and an unapproved one.
The office version of this process, with a rollout order and a rollback plan, is in the guide to a USB autorun policy for office PCs. For the data-theft angle, the write-up on preventing USB data leaks covers monitoring and policy choices.
How to Re-enable USB Ports Safely
Re-enabling is the same change in reverse, done by an administrator. Software blocks switch off with the password, the USBSTOR value returns to 3, and policies return to Not configured. Keep the exported registry file until the reversal is confirmed on the PC itself.
| Method used | How to reverse | Restart needed |
|---|---|---|
| Settings toggle | Turn AutoPlay back on | No |
| Group Policy | Set the policy to Not configured, then run gpupdate /force | Sign-out |
| Registry autorun values | Delete the two values or import your backup file | Sign-out |
| USBSTOR Start = 4 | Set Start back to 3 | Yes |
| Blocking software | Enter the password and switch protection off | Usually no |
reg add "HKLM\SYSTEM\CurrentControlSet\Services\USBSTOR" /v Start /t REG_DWORD /d 3 /fIf the password for a software block is lost, only the vendor can advise on recovery, so store it in a password manager when you set it. Use this only on PCs you own or administer.
Netsoftwares USB Block
Netsoftwares USB Block is a Windows utility from NewSoftwares.net for stopping USB storage devices from being used on a PC. It runs behind a password, keeps a log and offers a stealth mode to reduce visibility. Because it blocks storage outright, it suits shared PCs better than personal laptops that need drives daily.
Stealth mode hides the application from casual view, which matters on a PC where a curious user might otherwise look for the off switch. It is a deterrent, not a lock against a determined administrator.
Product pages sometimes list awards and download-site ratings, and those are the vendor's claims. Judge it by the features you can test: install it on a spare PC, plug in a drive, and read the log.

USB Malware Blocker
A USB malware blocker can mean two different things: a tool that stops drives from connecting, or one that scans what is on them. USB Block belongs to the first group. If you need detection of known malware, pair it with a scanner such as Microsoft Defender Antivirus, which Windows already includes.
USB Blocking Software Compared With Built-in Options
Built-in options cost nothing and cover the prompt and the class, while blocking software adds a password, a log and an interface. The table puts them side by side. For one personal PC the free route is enough, and for shared or audited PCs the extras start to earn their price.
| Option | Cost | What it blocks | Allow-list | Log of attempts | Best for |
|---|---|---|---|---|---|
| Windows autorun settings | Free | Stops the prompt | No | No | Everyone |
| Removable Storage Access policy | Free | Denies storage by class | Yes by policy | Event logs only | Pro and above |
| USBSTOR registry value | Free | Stops the storage driver | No | No | Emergency use |
| USB Block | Paid, see store | Blocks storage with a password | Check the product page | Yes | Shared PCs |
Frequently Asked Questions About Disabling Autorun for USB Drives
Ten questions cover what most readers ask after trying the steps: speed, cost, mistakes, verification, keyboard behaviour, phone charging, Windows Home, re-enabling and allow-lists. Type in the filter box to narrow the list to the question you need.
How to disable autorun for usb drives?
Open Settings, choose Bluetooth & devices, then AutoPlay, and turn off Use AutoPlay for all media and devices. For every account on the PC, an administrator can enable the Group Policy Turn off AutoPlay for all drives, or set the NoDriveTypeAutoRun registry value to 255 and NoAutorun to 1. Sign out afterwards so Explorer reads the change.
Can I disable autorun for usb drives without paid software?
Yes. Windows includes everything needed: the Settings toggle, the Group Policy editor on Pro and above, and two registry values for Home. All three are free and reversible. Paid software only becomes relevant when you also want to stop unknown drives from mounting, keep a log of connections, or manage several PCs from one place.
What is the fastest way to disable autorun for usb drives?
The Settings toggle is fastest, taking about a minute and no restart. Press the Windows key with I, go to Bluetooth & devices, open AutoPlay and switch the master toggle off. It affects only your account, so on a shared PC follow it with the registry or policy method to cover everyone.
What mistakes should I avoid when I disable autorun for usb drives?
Avoid setting only the current-user value on a shared PC, choosing a narrow bit mask such as 0x04, trusting the Settings page after applying a policy, and skipping the registry export. Also remember that turning autorun off does not scan anything, so keep your antivirus running and scan unknown drives before opening their files.
How do I check that it worked after I disable autorun for usb drives?
Run the PowerShell check shown in the verification section. NoDriveTypeAutoRun should read 255 and NoAutorun should read 1 if you set both. Then plug in a drive you trust: nothing should open by itself, and its files should appear only when you browse to the drive in File Explorer.
Can I block USB storage but keep my keyboard and mouse working?
Yes, as long as the block targets storage rather than the whole controller. The Removable Storage Access policy and class-based tools leave keyboards and mice alone because those use a different device class. Disabling USB controllers in Device Manager or BIOS removes every device on the port, so avoid that route on a PC you still type on.
Does blocking USB ports stop phone charging?
Usually not. Charging draws power, and a storage block only stops the phone from mounting as a drive. Some tools block at the port level, which can cut data while still supplying power, but behaviour varies by hardware. Test with your own phone and cable before rolling a block out to a team.
Will USB blocking work on Windows Home?
Registry-based blocking works on Home, because the USBSTOR value and the autorun values are ordinary registry entries. The Local Group Policy Editor is not included, so the policy route is unavailable there. Dedicated blocking software is the other option on Home, and it adds a log and a password that the registry route lacks.
How do I re-enable USB ports as the administrator?
Reverse whichever method you used. For software, enter its password and switch protection off. For the USBSTOR registry value, set Start back to 3 and restart. For Group Policy, set the policy to Not configured and run gpupdate. Always sign in as an administrator, and keep the exported .reg file as your fallback.
Can I allow only one approved USB drive?
Windows can do this by device ID: deny all removable storage, then allow the specific hardware ID or device instance of the approved drive. It works but needs careful setup and testing. Check any blocking tool for an allow-list feature before relying on it, and remember that two drives of the same model can share a hardware ID.
Go Deeper With These Companion Guides
Four companion guides each take one question from this page to full depth: telling AutoPlay from AutoRun, the Windows Home registry route, drives whose files became shortcuts, and policy for office PCs. Start with the one that matches your situation rather than reading them all.
AutoPlay vs AutoRun
Which setting does what, and which one you actually need.
Windows Home registry route
Exact keys, an undo file and a PowerShell version.
Files turned into shortcuts
Recover hidden folders safely and clean the drive.
Office PC policy
A tested rollout order, with logging and exceptions.
Our Verdict
Turn AutoPlay off, set the two registry values, keep Defender running and scan unknown drives. That free combination handles the autorun risk. Add a storage block only where unknown drives should never connect, and treat any block as a complement to antivirus, never a replacement.
Autorun settings are a hygiene step, not a shield. Do them first because they cost nothing, then decide on the stronger controls by looking at who uses the PC and what it holds.
