USB Block Settings: How to Block USB Ports in Windows
In this article
USB block settings are the Windows policy and registry controls that stop removable USB drives from being read or written to on a computer. On Windows Pro and Enterprise, the main switch lives in the Group Policy editor under Computer Configuration > Administrative Templates > System > Removable Storage Access; on Windows Home, the same effect is done with a registry edit.
Time 15 min · Steps 6 · Level Medium
On Windows, blocking USB storage is a policy setting, not a physical lock, and the most common mistake is editing Group Policy on a Home edition where it has no effect. Windows Home simply does not ship the Group Policy editor, so the registry route is the only reliable one there. Also note that blocking removable storage does not block keyboards, mice or chargers, because those are not storage devices. Menu names below can differ slightly between Windows versions.
The six steps to block USB storage in Windows
- Check your Windows edition. Press the Windows key, type "about", and open About your PC. If it says Pro, Enterprise or Education, use Group Policy. If it says Home, use the registry method below.
- Open the Group Policy editor. Press the Windows key, type "gpedit", and open Edit Group Policy. This tool is not present on Home editions.
- Navigate to Removable Storage Access. Go to Computer Configuration > Administrative Templates > System > Removable Storage Access. This folder holds one policy per removable device class.
- Set the policy. Double-click "Removable Disks: Deny read access" and "Removable Disks: Deny write access", set each to Enabled, and click OK. Enabling both makes USB drives invisible and unusable for data.
- Apply the change. Open a Command Prompt as administrator and run gpupdate /force, or simply restart the computer. The setting takes effect for every user account on that machine.
- Test with a spare USB drive. Plug in a drive you do not mind wiping. If the policy is working, the drive either does not appear in File Explorer or opening it returns an access-denied message.
Where the USB block settings live on Windows Home
On Home editions, the same block is set through the Registry Editor, and it works by denying the USB storage driver rather than through policy. Open the Start menu, type "regedit", and open Registry Editor. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR. Find the Start value on the right-hand side; a value of 3 means the service runs normally, and changing it to 4 disables it. Double-click Start, change the value data to 4, click OK, and restart the computer. After the restart, USB drives are not mounted, though USB keyboards and mice keep working because they use different drivers. To undo the block, set Start back to 3 and restart again.
Editing the registry carries some risk, so it is worth exporting the USBSTOR key first: right-click the folder name in the left pane and choose Export to save a backup file you can double-click to restore. If the USBSTOR key does not exist on your machine, do not create it blindly; check that you are in the right hive and path first.
Which USB block method fits your situation
The right method depends on who you are protecting and how many computers are involved. One laptop needs one registry edit; a whole office needs policy or device management.
| Situation | Best setting to use | Scope |
|---|---|---|
| Personal PC, Windows Home | Registry USBSTOR Start = 4 | That one computer, all users |
| Personal PC, Windows Pro | Group Policy, deny read and write | That one computer, all users |
| Several work PCs | Group Policy from a domain controller | Every joined computer |
| Managed fleet with sign-in | Mobile device management removable-storage policy | Enrolled devices only |
| Blocking one lost or risky device | Device Manager uninstall plus physical port block | That device on that computer |
A quick rule of thumb: if you only need to stop data walking out the door, deny write access but leave read access on, so people can still receive files on a USB stick. If you are blocking malware entry as well, deny both.
Blocking USB storage on Android and Mac
On Android phones, USB storage is controlled from the USB preferences that appear in the notification shade when a cable is connected; choosing "No data transfer" or "Charging only" stops file access for that connection. Company-managed Android devices can have USB file transfer disabled entirely by the device owner policy, which is set by whoever manages the fleet, not from the phone's Settings app. There is no general toggle in Android Settings that permanently blocks all USB data.
On a Mac, USB blocking is handled through screen-time-style restrictions or mobile device management profiles rather than a single Settings switch. If you manage Macs centrally, the removable-media restriction is configured in the management console; on a single home Mac there is no built-in permanent block, so the practical approach is limiting who can log in with an administrator account.
What to do when the USB block does not take
If a USB drive still opens after you enabled the policy, the usual cause is that the change was never applied. Run gpupdate /force from an administrator Command Prompt, then sign out and back in; some removable-storage policies refresh only at logon. If the setting applied but a drive still appears, check that you enabled the "Removable Disks" policy rather than the similar ones for CD and DVD or tape, which sit in the same folder and are easy to mix up.
On the registry route, the common failure is editing the value on the wrong service. USBSTOR controls USB mass-storage drives; a value of 4 there blocks flash drives and external hard drives but not phones connected in file-transfer mode, which mount through a different path. If your goal is blocking phone transfers too, the Group Policy route with both deny settings is broader.
If the drive is blocked but you need to unblock it for one person, Group Policy lets you exempt a group: the Removable Storage Access folder includes options to deny access to everyone except a listed group, so IT staff can keep access while everyone else is blocked. On Home editions there is no per-user exemption; the registry switch is all or nothing.
Checking that your USB block actually works
Test with two different devices: a plain flash drive and a phone in file-transfer mode. A working block makes the flash drive invisible or access-denied in File Explorer, and the phone should charge without its storage appearing. Then check the other direction by plugging in a USB keyboard or mouse; those should still work, and if they do not, you have disabled something broader than USB storage and should undo the change. Finally, restart once more and retest, because a block that survives a reboot is the only one you can rely on.
Official source: Microsoft Support