Windows 11 · Windows 10 · Updated October 16, 2026
How to Disable USB Ports in Windows 11 Laptop or PC
There are two different jobs: block USB drives and turn ports off. Most people only need the first, and it will not break your keyboard or mouse. This guide shows both, with lockout warnings, undo steps and a finder that picks the right method.

Quick answer
Pro or Enterprise: gpedit.msc → Computer Configuration → Administrative Templates → System → Removable Storage Access → All Removable Storage classes: Deny all access → Enabled. Home: run reg add "HKLM\SYSTEM\CurrentControlSet\Services\USBSTOR" /v Start /t REG_DWORD /d 4 /f in an admin Command Prompt.
Turning off a USB Root Hub switches off every device on it, including a USB keyboard or mouse. Use the lock-out check first.
Lock-out check
Tick what you use on USB today. The check tells you which methods are safe for you.
Method finder
Pick your Windows edition and your goal. Matching methods light up, sorted from lowest to highest lockout risk.
What each method blocks
“Partly” means it depends on the device or on whether it is already installed.
| Method | USB drives | Keyboard, mouse | Phones (MTP) | Editions |
|---|---|---|---|---|
| Registry USBSTOR = 4 | Yes | No | Partly | All |
| Group Policy: Deny all access | Yes | No | Yes | Pro+ |
| Registry policy Deny_All | Yes | No | Yes | All |
| Device installation restrictions | Partly | No | Partly | Pro+ |
| Device Manager: disable hubs | Yes | Yes | Yes | All |
| BIOS or UEFI | Yes | Yes | Yes | Most PCs |
| Intune or Defender control | Yes | No | Yes | Licence |
| Port blocker | Yes | Yes | Yes | All |
Removable storage policies deny access. They do not cut power to a port. For ports that are truly off, use BIOS or a physical blocker.
The 13 methods
Part A is safest. Each method has an undo line.
Block USB storage only
Keeps keyboards, mice and headsets working. Start here.
1Registry: switch off the USB storage driver (USBSTOR)Changes settingsAll editions · blocks flash drives and external disks
What it does: USBSTOR is the driver for USB mass storage. Setting it to 4 stops Windows loading it. USB keyboards, mice and headsets use other drivers and keep working.
- Open Start, type
cmd, right-click Command Prompt and choose Run as administrator. - Run the command below.
- Unplug any USB drive that is already connected, then reconnect it to test. A restart makes the change certain.
reg add "HKLM\SYSTEM\CurrentControlSet\Services\USBSTOR" /v Start /t REG_DWORD /d 4 /f
Phones and cameras that connect as MTP use a different driver, so this does not stop them. Use Fix 2 or 3 to cover them. Drivers or updates can also restore the value, so re-check it.
Undo: Set the value back to 3: reg add "HKLM\SYSTEM\CurrentControlSet\Services\USBSTOR" /v Start /t REG_DWORD /d 3 /f
2Group Policy: deny all removable storageChanges settingsPro, Enterprise, Education · cleanest storage block
What it does: This policy denies access to every removable storage class, not only USB sticks. It covers external disks, optical drives and portable devices such as phones. It does not touch keyboards or mice.
- Press Win + R, type
gpedit.mscand press Enter. - Go to Computer Configuration → Administrative Templates → System → Removable Storage Access.
- Open All Removable Storage classes: Deny all access, choose Enabled, then Apply and OK.
- Refresh the policy with the command below, then test with a USB drive.
gpupdate /target:computer /force
For a softer rule, enable only Removable Disks: Deny write access in the same folder. People can open files but cannot copy data out.
Undo: Set the policy to Not Configured or Disabled, then run gpupdate /force.
3Windows 11 Home: set the same policy in the registryChanges settingsHome and every edition · no gpedit needed
What it does: Windows 11 Home has no Group Policy editor, but the policy is just a registry value. This writes the value that “Deny all access” would write.
- Open PowerShell as administrator (right-click Start, choose Terminal (Admin)).
- Paste the commands below and press Enter.
- Restart the PC, then test a USB drive.
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\RemovableStorageDevices" -Force | Out-Null New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\RemovableStorageDevices" -Name Deny_All -PropertyType DWord -Value 1 -Force
Undo: Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\RemovableStorageDevices" -Name Deny_All
4Stop new removable devices from installingChanges settingsPro, Enterprise, Education · adds a second layer
What it does: Device Installation Restrictions stop Windows installing a driver for new removable devices. It works best together with Fix 2, because a device Windows already installed may keep working.
- Open
gpedit.mscand go to Computer Configuration → Administrative Templates → System → Device Installation → Device Installation Restrictions. - Enable Prevent installation of removable devices.
- Optional: add a custom message so people know the block is intentional.
- Run
gpupdate /target:computer /forceand restart.
Undo: Set the policy back to Not Configured.
Turn ports off
Blocks everything on a port. Higher lockout risk.
5Device Manager: disable USB hubs or controllersCan lock you outAll editions · turns off everything on those ports
What it does: Disabling a USB Root Hub or controller turns off every port behind it. Keyboards, mice, headsets and webcams on those ports stop working too.
- Make a restore point first: search Create a restore point and choose Create.
- Right-click Start and open Device Manager. Expand Universal Serial Bus controllers.
- Right-click a USB Root Hub (or host controller) and choose Disable device. Confirm.
- Test with a USB drive. Repeat for other hubs only if needed.
If your keyboard and mouse are USB on the same hub, you can lose control of the PC. A laptop touchpad or a Bluetooth keyboard helps. Try Fix 6 to disable just one hub.
Undo: Right-click the disabled hub and choose Enable device. If you cannot use the input, see Fix 13.
6Find which hub a physical port uses (disable just one port)No riskAll editions · lets you target one port
What it does: Windows does not label ports on the case. You find the right hub by plugging a device in and watching where it appears.
- Open Device Manager. Choose View → Devices by connection.
- Plug a USB device into the port you want to block and watch which USB Root Hub branch shows a new entry.
- Check what else sits on that hub. If your keyboard or mouse is there, pick a different port to test.
- Disable only that hub, or use Fix 7 with its Instance ID.
On many laptops several ports share one controller, so you cannot always disable one port alone. If so, use BIOS options (Fix 8) or a port blocker (Fix 10).
7Command line and PowerShell methodsChanges settingsAll editions · scriptable
What it does: Use these to script Fix 1, or to disable a specific device by its Instance ID. Cmd and PowerShell do the same things as the manual steps.
- Open Terminal (Admin).
- List USB devices and note the InstanceId of the one you want.
- Disable it with the second command. Enable it again with the third.
Get-PnpDevice -Class USB | Select-Object FriendlyName, Status, InstanceId Disable-PnpDevice -InstanceId "PASTE_INSTANCE_ID_HERE" -Confirm:$false Enable-PnpDevice -InstanceId "PASTE_INSTANCE_ID_HERE" -Confirm:$false
Do not disable the hub that your keyboard or mouse uses. Test on a device you can spare first.
Undo: Run Enable-PnpDevice with the same Instance ID.
8BIOS or UEFI: turn the ports off in firmwareCan lock you outMany laptops and PCs · strongest block
What it does: Firmware settings turn ports off before Windows loads. Software cannot switch them back on. This is the real way to disable ports.
- Restart and press the setup key as it starts (often F2, Del, F10 or F12, depending on the maker).
- Look for USB Configuration, Integrated Peripherals or Security → I/O Port Access.
- Disable the USB ports you want off, or USB storage if offered. Save and exit.
- Set a BIOS or supervisor password so others cannot undo it.
Menu names and options vary by maker, and many laptops only let you switch off some ports. Leave at least one working keyboard or mouse option, or you may be unable to get back into setup.
Undo: Enter setup again and set the ports to Enabled.
Managed PCs and hardware
For fleets and shared machines.
9Intune or Defender device control for work PCsChanges settingsManaged fleets · allow-list by device
What it does: Cloud-managed PCs can block USB storage and still allow approved devices, by hardware ID or serial number, with reports.
- In Microsoft Intune, open Endpoint security → Attack surface reduction and create a Device control or removable-storage policy (names vary by licence).
- Start with a pilot group. Add an allow list for approved devices.
- Assign to your devices and check reports for blocked events.
- On domain PCs without Intune, combine Fix 2 and Fix 4 in a Group Policy Object linked to the right OU.
Some device control features need specific Microsoft 365 or Defender licences. Check your plan before you plan the rollout.
Undo: Remove the assignment or set the policy to Not configured.
10Physical port blockers and USB-C notesNo riskAll devices · cannot be undone by software
What it does: Plastic or lockable port blockers are the only method that works even if someone has admin rights.
- Buy blockers sized for USB-A or USB-C ports, with lockable ones for shared PCs.
- Fit one in each port you want blocked.
- For USB-C and Thunderbolt, remember the port may also carry charging and video. Blocking it can stop charging, so keep one charging port free.
Undo: Remove the blockers.
Keep, undo and fix
Power saving, undo steps and troubleshooting.
11Stop USB ports from turning off (selective suspend)Changes settingsAll editions · for ports that sleep or drop devices
What it does: This is the opposite problem: Windows powers down idle USB ports to save energy. Devices then disconnect or stop responding.
- Open Control Panel → Power Options → Change plan settings → Change advanced power settings.
- Open USB settings → USB selective suspend setting and set it to Disabled for plugged in and on battery.
- In Device Manager, open each USB Root Hub → Properties → Power Management and clear Allow the computer to turn off this device to save power.
- Or run the commands below as administrator.
powercfg /setacvalueindex SCHEME_CURRENT 2a737441-1930-4402-8d77-b2bebba308a3 48e6b7a6-50f5-4782-a5d4-53bb8f07e226 0 powercfg /setdcvalueindex SCHEME_CURRENT 2a737441-1930-4402-8d77-b2bebba308a3 48e6b7a6-50f5-4782-a5d4-53bb8f07e226 0 powercfg /setactive SCHEME_CURRENT
Undo: Set the same value to 1 to enable selective suspend again.
12Re-enable USB ports and storage (undo)No riskUse the row that matches what you did
What it does: Each method has its own undo. Use the one that matches, then restart.
- Registry USBSTOR: set Start back to 3.
- Group Policy: set the policy to Not Configured and run
gpupdate /force. - Home registry policy: delete
Deny_All. - Device Manager or PowerShell: Enable device or
Enable-PnpDevice. - BIOS: set the ports to Enabled.
- Intune: remove the assignment, then sync the device.
reg add "HKLM\SYSTEM\CurrentControlSet\Services\USBSTOR" /v Start /t REG_DWORD /d 3 /f gpupdate /force
13Troubleshoot: block not working, or locked outNo riskRead this if something went wrong
What it does: Most “USB still works” cases are a scope mismatch, a phone using MTP, or a policy that did not refresh. Most lockouts come from disabling hubs your input uses.
- Drive still works: unplug and reconnect it, restart, and run
gpupdate /force. A device that was already installed can keep working until you unplug it. - Phone still transfers files: phones use MTP. Use Fix 2 or 3, which cover portable devices.
- Policy not applying: check that the policy is under Computer Configuration and that you edited the correct GPO or OU.
- Keyboard or mouse dead after Fix 5: use the laptop touchpad, an on-screen keyboard, a Bluetooth keyboard, or a remote session to re-enable the hub. If that is impossible, restore from System Restore in Windows Recovery.
- Charging stopped after a BIOS change: re-enter setup and re-enable the charging port.
Frequently asked questions
How do I disable USB ports in Windows 11?
What is the difference between disabling USB ports and USB storage?
Can I disable USB ports on Windows 11 Home?
How do I disable USB ports using cmd or Command Prompt?
How do I disable USB ports with PowerShell?
Can I disable just one USB port?
Will disabling USB storage stop charging?
Will my keyboard and mouse stop working?
How do I disable USB ports in the BIOS?
How do I enable USB ports again?
Does it work on a laptop and a desktop PC the same way?
Why does a USB drive still work after I blocked it?
Does a phone still transfer files after blocking USB storage?
How do I disable USB ports for a college or work PC?
Can I disable USB ports remotely or through RDP?
Does Windows Update turn USB back on?
How do I stop USB ports from turning off?
Is disabling USB ports a good security step?
Will this work in a virtual machine or Hyper-V?
Which method should I use?
Bottom line
Block storage, not the ports, unless you must. Group Policy or the registry stops USB drives and leaves keyboards and mice alone. Use hubs, BIOS or physical blockers only when you need ports truly off, and keep an undo step ready.
Run the finder again