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.

1Block USB storage2Block new devices3Disable hubs4BIOS off5Physical block
Windows 11 Device Manager with USB Root Hub disable option and a USB port

Quick answer

✅
Safest way to block USB drives

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.

⚠️
Before you disable hubs

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.

MethodUSB drivesKeyboard, mousePhones (MTP)Editions
Registry USBSTOR = 4YesNoPartlyAll
Group Policy: Deny all accessYesNoYesPro+
Registry policy Deny_AllYesNoYesAll
Device installation restrictionsPartlyNoPartlyPro+
Device Manager: disable hubsYesYesYesAll
BIOS or UEFIYesYesYesMost PCs
Intune or Defender controlYesNoYesLicence
Port blockerYesYesYesAll
💡
Group Policy is not a power switch

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.

A

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.

  1. Open Start, type cmd, right-click Command Prompt and choose Run as administrator.
  2. Run the command below.
  3. Unplug any USB drive that is already connected, then reconnect it to test. A restart makes the change certain.
Command Prompt (Administrator)
reg add "HKLM\SYSTEM\CurrentControlSet\Services\USBSTOR" /v Start /t REG_DWORD /d 4 /f
⚠️
Not a full block

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.

  1. Press Win + R, type gpedit.msc and press Enter.
  2. Go to Computer Configuration → Administrative Templates → System → Removable Storage Access.
  3. Open All Removable Storage classes: Deny all access, choose Enabled, then Apply and OK.
  4. Refresh the policy with the command below, then test with a USB drive.
Command Prompt (Administrator)
gpupdate /target:computer /force
💡
Allow read but not write

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.

  1. Open PowerShell as administrator (right-click Start, choose Terminal (Admin)).
  2. Paste the commands below and press Enter.
  3. Restart the PC, then test a USB drive.
PowerShell (Administrator)
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.

  1. Open gpedit.msc and go to Computer Configuration → Administrative Templates → System → Device Installation → Device Installation Restrictions.
  2. Enable Prevent installation of removable devices.
  3. Optional: add a custom message so people know the block is intentional.
  4. Run gpupdate /target:computer /force and restart.

Undo: Set the policy back to Not Configured.

B

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.

  1. Make a restore point first: search Create a restore point and choose Create.
  2. Right-click Start and open Device Manager. Expand Universal Serial Bus controllers.
  3. Right-click a USB Root Hub (or host controller) and choose Disable device. Confirm.
  4. Test with a USB drive. Repeat for other hubs only if needed.
⚠️
Lockout risk

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.

  1. Open Device Manager. Choose View → Devices by connection.
  2. Plug a USB device into the port you want to block and watch which USB Root Hub branch shows a new entry.
  3. Check what else sits on that hub. If your keyboard or mouse is there, pick a different port to test.
  4. Disable only that hub, or use Fix 7 with its Instance ID.
💡
Not every port has its own hub

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.

  1. Open Terminal (Admin).
  2. List USB devices and note the InstanceId of the one you want.
  3. Disable it with the second command. Enable it again with the third.
PowerShell (Administrator)
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
⚠️
Check before you run

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.

  1. Restart and press the setup key as it starts (often F2, Del, F10 or F12, depending on the maker).
  2. Look for USB Configuration, Integrated Peripherals or Security → I/O Port Access.
  3. Disable the USB ports you want off, or USB storage if offered. Save and exit.
  4. Set a BIOS or supervisor password so others cannot undo it.
⚠️
Do not turn off every USB port

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.

C

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.

  1. In Microsoft Intune, open Endpoint security → Attack surface reduction and create a Device control or removable-storage policy (names vary by licence).
  2. Start with a pilot group. Add an allow list for approved devices.
  3. Assign to your devices and check reports for blocked events.
  4. On domain PCs without Intune, combine Fix 2 and Fix 4 in a Group Policy Object linked to the right OU.
💡
Licence needed

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.

  1. Buy blockers sized for USB-A or USB-C ports, with lockable ones for shared PCs.
  2. Fit one in each port you want blocked.
  3. 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.

D

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.

  1. Open Control Panel → Power Options → Change plan settings → Change advanced power settings.
  2. Open USB settings → USB selective suspend setting and set it to Disabled for plugged in and on battery.
  3. In Device Manager, open each USB Root Hub → Properties → Power Management and clear Allow the computer to turn off this device to save power.
  4. Or run the commands below as administrator.
Command Prompt (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.

  1. Registry USBSTOR: set Start back to 3.
  2. Group Policy: set the policy to Not Configured and run gpupdate /force.
  3. Home registry policy: delete Deny_All.
  4. Device Manager or PowerShell: Enable device or Enable-PnpDevice.
  5. BIOS: set the ports to Enabled.
  6. Intune: remove the assignment, then sync the device.
Command Prompt (Administrator)
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.

  1. 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.
  2. Phone still transfers files: phones use MTP. Use Fix 2 or 3, which cover portable devices.
  3. Policy not applying: check that the policy is under Computer Configuration and that you edited the correct GPO or OU.
  4. 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.
  5. 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?
Decide whether you want to block only USB storage or every device. For storage only, use Group Policy or the USBSTOR registry value. To turn ports off, use Device Manager or BIOS (Fix 1, 2, 5, 8).
What is the difference between disabling USB ports and USB storage?
Disabling storage blocks flash drives and external disks only. Disabling ports or hubs blocks everything on them, including keyboards and mice.
Can I disable USB ports on Windows 11 Home?
Yes. Home has no Group Policy editor, but Device Manager, PowerShell, cmd and the registry policy work (Fix 3, 5, 7).
How do I disable USB ports using cmd or Command Prompt?
Run the reg add command for USBSTOR as administrator to block USB storage (Fix 1). Cmd cannot disable a single hub without extra tools, so use PowerShell for that (Fix 7).
How do I disable USB ports with PowerShell?
List devices with Get-PnpDevice -Class USB, then use Disable-PnpDevice with the Instance ID. Enable-PnpDevice reverses it (Fix 7).
Can I disable just one USB port?
Only if that port has its own controller. Use Devices by connection in Device Manager to see where it sits. If ports share a hub, use BIOS or a physical blocker (Fix 6, 8, 10).
Will disabling USB storage stop charging?
No. Blocking USBSTOR or using the removable storage policy leaves power available. Disabling hubs or ports in BIOS may stop charging on some devices.
Will my keyboard and mouse stop working?
Not with storage blocks (Fix 1 to 4). They can stop if you disable the hub they use (Fix 5 and 8). Keep a touchpad or Bluetooth device ready.
How do I disable USB ports in the BIOS?
Restart and open setup, find the USB or I/O port settings, disable the ports, save and exit. Add a BIOS password. Menus differ by maker (Fix 8).
How do I enable USB ports again?
Reverse the method you used: set USBSTOR back to 3, set the policy to Not Configured, enable the device, or enable the BIOS option (Fix 12).
Does it work on a laptop and a desktop PC the same way?
Yes. Software methods are the same. BIOS options differ by model, and laptops usually offer fewer port-level choices.
Why does a USB drive still work after I blocked it?
The device may already be installed, the policy may not have refreshed, or the drive uses a different class. Unplug it, run gpupdate /force and restart (Fix 13).
Does a phone still transfer files after blocking USB storage?
It can. Phones use MTP, which USBSTOR does not control. The Deny all access policy covers portable devices (Fix 2, 3).
How do I disable USB ports for a college or work PC?
Only change a PC you own or have permission to manage. Managed devices are controlled by the school or employer, and bypassing their policy can break the rules. IT can use Group Policy or Intune (Fix 2, 9).
Can I disable USB ports remotely or through RDP?
Group Policy and Intune apply remotely. USB drive sharing through Remote Desktop is a separate redirection setting that you control in the Remote Desktop policies.
Does Windows Update turn USB back on?
Some users report that driver changes can restore a setting. Policy-based methods are more durable, so check the value after major updates.
How do I stop USB ports from turning off?
Disable USB selective suspend in Power Options and clear the Power Management check box on each USB Root Hub (Fix 11).
Is disabling USB ports a good security step?
It reduces data theft and malware from USB drives. Pair it with a device allow-list for approved devices, and use physical blockers on shared PCs (Fix 9, 10).
Will this work in a virtual machine or Hyper-V?
USB reaches a VM through the host, so blocking on the host also blocks pass-through. Apply the steps on the host.
Which method should I use?
For most people, Group Policy (Pro) or the registry policy (Home) to block storage. Use BIOS or blockers only when you need ports truly off.

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