How to Disable USB Ports from the Command Line: Step-by-Step Guide 2026
No single command switches off a USB port. A command can stop Windows from loading the storage driver, deny removable storage by policy, or disable chosen device entries, and each of those blocks a different set of devices. This guide covers Windows 10 and 11, shows what every command leaves working, and gives the rollback for each.
Run reg add HKLM\SYSTEM\CurrentControlSet\Services\USBSTOR /v Start /t REG_DWORD /d 4 /f from an elevated Command Prompt, then restart. Windows stops loading the USB storage driver, so flash drives and external disks no longer mount. Keyboards and mice keep working. Phones need a separate policy.
| Applies to | Windows 10 and Windows 11, all editions for the registry command |
|---|---|
| Time needed | About 5 minutes plus one restart |
| Difficulty | Moderate: administrator rights and a registry edit |
| Cost | Free, built-in commands |
| Needs admin or internet | Admin: yes. Internet: no |
| Last verified | November 2026 |
The short version
How to Disable USB Ports from the Command Line: Quick Answer
To disable USB storage from the command line on Windows 10 or 11, run an elevated reg add that sets the USBSTOR service Start value to 4, then restart. Keyboards, mice and hubs keep working because only the mass-storage driver is switched off.
Three command-line routes exist, and they differ in what they stop. The USBSTOR value stops storage drives. The Removable Storage Access policy value stops removable storage classes, including optical drives. The pnputil and PowerShell device commands stop whichever devices you name. None of them powers a port off; for that you need a BIOS or UEFI setting.
If you only need to stop flash drives and external disks
Use the USBSTOR value. It is one line, works on Home and Pro, and reverses by setting the value back to 3. The full command and its PowerShell twin are in the step-by-step section below.
If phones and cameras must be blocked too
Phones and cameras connect as portable devices, not as USB drives, so the USBSTOR value does not cover them. The Windows Portable Devices (WPD) deny policies do. Reports on Microsoft’s Q&A site describe phones staying readable under the general deny policy until the WPD settings were enabled.
If several PCs need the same rule
Set the policy once in Group Policy or your device-management tool instead of typing commands on each machine. The comparison table further down shows where each method fits.
Pick your path:
Before you type anything
Requirements and rollback plan before you change USB settings
You need an administrator account, Windows 10 or 11, a spare USB drive for testing and about five minutes. The registry and device commands in this guide are all blocked for standard users, so run every command from an elevated prompt.
- Administrator rights. Microsoft’s PowerShell documentation states that Disable-PnpDevice must be run from an administrator account, and the registry keys involved are protected the same way.
- Edition awareness. The Local Group Policy Editor ships with Windows Pro, Enterprise and Education. Windows Home does not include it, so on Home you rely on registry commands.
- A spare drive. Use a drive you do not mind plugging in repeatedly. Test with it before and after the change.
- A way back. Know the reversing command before you apply the blocking one.
The rollback-first rule
- Export the key you are about to change to a .reg file.
- Change one value only, and write down its old data.
- Restart, then test with the spare drive before you leave the machine.
Microsoft’s archived guidance on blocking USB storage warns that serious problems can follow if the registry is edited incorrectly, and tells you to back up the registry first. Export the single key rather than the whole registry; it restores in seconds.
The case for blocking
Why Block USB Ports at All
USB storage moves data in both directions. A drive can carry files out of a PC without leaving a trace in email logs, and it can carry malware in. Blocking storage at the driver removes both paths on that machine.
USB data theft and insider-risk basics
A flash drive holds hundreds of gigabytes in a pocket, and copying takes seconds. Shared PCs, front-desk machines and anything holding client or financial files carry the highest exposure. Blocking storage does not stop screenshots or cloud uploads, so treat it as one control among several.
How malware reaches a PC through a USB drive
A drive can carry an infected document or program that runs the moment someone opens it. Drives also move between home and work machines, so one careless plug-in can reach several systems. How-To Geek notes that delivering malware through USB devices is relatively common, which is why blocking removable storage appears in so many security baselines.
Risk score card: is your PC exposed through USB?
Few open paths. A single storage rule and a spare-drive test is enough for now.
The commands
Step-by-Step: Disable USB Ports from the Command Line
Three command-line methods cover most cases: setting the USBSTOR start type, writing the Removable Storage Access policy value, and disabling devices with pnputil or PowerShell. Run each from an elevated prompt. The first two change rules; the third changes devices.
Method 1: set the USBSTOR start type
USBSTOR is the Windows service that drives USB mass-storage devices. Microsoft’s documentation says setting its Start value to 4 stops an already-installed USB storage device from working when a user connects it. The default value is 3, which means start on demand.
- Open an elevated prompt.Right-click Start and choose Terminal (Admin), or search for cmd and pick Run as administrator.
- Export the key as a backup.Command Prompt
reg export HKLM\SYSTEM\CurrentControlSet\Services\USBSTOR C:\usbstor-backup.reg - Set Start to 4.Windows answers “The operation completed successfully.”Command Prompt
reg add HKLM\SYSTEM\CurrentControlSet\Services\USBSTOR /v Start /t REG_DWORD /d 4 /f - Restart Windows.How-To Geek tells readers to restart for the change to apply on Windows 11, and a restart also clears any driver already loaded for a mounted drive.
The PowerShell form does the same thing and is easy to wrap in a script:
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\USBSTOR" -Name "Start" -Value 4Microsoft’s archived article splits the problem. If a USB storage device is already installed, set Start to 4. If none has been installed yet, it suggests denying permissions on the Usbstor.inf and Usbstor.pnf files in the Inf folder, which stops the driver from installing at all. The second route changes file permissions, including for SYSTEM, so it carries more side effects.
Method 2: write the Removable Storage Access policy value
The Group Policy setting All Removable Storage classes: Deny all access stores its choice as a registry value named Deny_All under the policies key. Microsoft’s ADMX reference documents that key path, and NinjaOne documents the DWORD value. Writing it by command gives you the policy effect without opening an editor.
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\RemovableStorageDevices" /v Deny_All /t REG_DWORD /d 1 /fMicrosoft’s device-management blog notes that if no forced reboot is configured, the access right does not take effect until the operating system restarts, so plan for a restart here too.
Method 3: disable devices with pnputil or PowerShell
pnputil ships in every Windows release, and its disable-device switch has existed since Windows 10 version 2004. Microsoft recommends pnputil over the older DevCon tool. List first, then disable by hardware or compatible ID. Never target the keyboard class.
pnputil /enum-devices /connected /class USB
pnputil /disable-device /deviceid "USB\Class_08"Get-PnpDevice -Class USB -PresentOnly
Disable-PnpDevice -InstanceId '<instance ID from the list>' -Confirm:$falseDisabling by device entry acts on the devices Windows already knows. A different drive with its own instance ID may be installed fresh, so treat this method as a precise tool, not a blanket rule.
Do not disable the USB root hub or every entry under Universal Serial Bus controllers on a PC you cannot physically reach. The keyboard and mouse usually sit behind those entries, and you can lose local input.
Side by side
Built-in Windows Methods Compared
Five built-in routes block USB in different places, from a BIOS switch that turns a port off to a policy that denies one class of device. The table shows scope, edition limits, whether a restart is needed and how each one reverses.
| Method | What it stops | Editions | Restart | How to reverse | Leaves working |
|---|---|---|---|---|---|
| USBSTOR Start = 4 | USB mass-storage driver | All, registry access only | Advised | Set Start to 3 | Keyboards, mice, printers |
| Deny_All policy value | Removable storage classes | Group Policy editor on Pro, Enterprise, Education; registry on all | Needed unless a forced reboot is set | Delete the value | Input devices |
| pnputil or Disable-PnpDevice | Only the devices you name | Windows 10 version 2004 and later for pnputil | Usually not | Enable-device or Enable-PnpDevice | Every device you did not name |
| Device Manager, disable a controller | Everything behind that controller | All | No | Enable device | Devices on other controllers |
| BIOS or UEFI setting | The whole port | Hardware dependent | Yes | Change the firmware setting | Nothing on that port |
| Verdict | Start with the USBSTOR value for storage only | Use the policy value when phones or optical drives matter |
Choosing a route
Best Free Methods to Disable USB Ports from the Command Line
Of the free routes, the USBSTOR value suits one PC, the Removable Storage policy suits a group of PCs, and pnputil suits one known device. The picker below maps your Windows edition, PC count and phone needs to a single route.
USB block method picker
Registry command or Group Policy. Either works on a single Pro PC. The Group Policy route is easier to read later; the command is faster to script.
The free methods share one limit: none of them has a password. Anyone with administrator rights can set Start back to 3 in a minute. If a family member or colleague has admin rights, a password-protected tool or a standard-user account is the stronger fix.
What gets blocked
USB device classes: what each command touches
USB devices announce a class, and the blocking commands act on classes, not on physical ports. Mass storage uses class 08, keyboards and mice use the HID class 03, and phones appear as portable devices. Knowing the class tells you whether a command will reach the device.
| Device class | Examples | USBSTOR Start = 4 | Removable Storage policy | Note |
|---|---|---|---|---|
| Mass storage | Flash drives, external disks, card readers | Blocked | Blocked (Removable Disks) | Standard drives use USBSTOR |
| USB Attached SCSI drives | Fast external SSDs | May not be covered | Test it | Windows uses a separate UASPStor driver for UAS |
| Portable devices (WPD) | Phones, cameras, media players | Not covered | Only with the WPD Devices policies | Phones use MTP or PTP, not USBSTOR |
| Optical and floppy | USB DVD drives | Not covered | Blocked with all-classes or CD and DVD policies | Separate policy entries exist |
| Human interface | Keyboards, mice | Left working | Left working | Never block this class by accident |
| Printers | USB printers | Left working | Left working | Separate driver |
How USB port blocking differs from disabling a single device
Blocking a class stops every device of that type on every port. Disabling a device stops one device entry, identified by its instance ID. A class block is a rule about types; a device disable is an action on one thing.
- Class block
- A policy or driver setting such as USBSTOR Start = 4. New devices of that class are refused automatically.
- Device disable
- A pnputil or PowerShell action on a named device. It does not cover other devices that appear later.
- Port off
- A firmware setting. It stops every device on that port, including keyboards, which is why BIOS-level blocking is rare on desktops you use daily.
Allow keyboard/mouse while blocking storage
The USBSTOR value and the Removable Storage policy both leave the HID class alone, so input keeps working. The trouble starts when you disable controllers or hubs, or when you use the install-restriction policies without allowing the keyboard, mouse and USB bus classes. The walkthrough for approved drives lists those class entries.
Three approaches
Group Policy vs registry vs software-based control
Group Policy writes the same registry values as the commands, but through an editor that documents each setting. The registry route is the quickest to script. Software adds a password, an allow list screen and activity reports that neither built-in route offers.
| Approach | Where you run it | Edition | Strength | Weakness |
|---|---|---|---|---|
| Registry command | Elevated prompt or script | All editions | Fast, scriptable, no editor needed | No password; admins can reverse it |
| Group Policy | Local editor or domain policy | Pro, Enterprise, Education | Documented settings, central deployment | Editor missing on Home |
| Software | A program on each PC | Windows versions the vendor lists | Password, allow list, reports | Another program to install and maintain |
The Local Group Policy Editor (gpedit.msc) is part of Windows Pro, Enterprise and Education. Typing gpedit.msc on Windows Home returns a “cannot find” error. Check your edition under Settings, System, About before choosing the policy route.
Policy rollout checklist for multi-PC offices
0 of 6 completed
Office USB policy generator
@echo off
rem Run from an elevated Command Prompt. Export the key first: reg export HKLM\SYSTEM\CurrentControlSet\Services\USBSTOR usbstor-backup.reg
reg add HKLM\SYSTEM\CurrentControlSet\Services\USBSTOR /v Start /t REG_DWORD /d 4 /f
rem --- Rollback (run to undo) ---
rem reg add HKLM\SYSTEM\CurrentControlSet\Services\USBSTOR /v Start /t REG_DWORD /d 3 /f
rem reg delete HKLM\SOFTWARE\Policies\Microsoft\Windows\RemovableStorageDevices /v Deny_All /f
rem Restart, then test with a spare drive.Exceptions
How to Allow Approved Drives Only
Windows can block every USB device that no policy describes and then allow named devices by hardware ID or instance ID. Done correctly, one company drive works and every other drive is refused, while the keyboard and mouse stay allowed through their device classes.
The setting names live under Device Installation Restrictions in Group Policy. Keyboards and USB hubs need explicit allow entries, or the block can reach them as well. Full walkthrough: allow only one approved USB drive.
Proof
How to Verify It Worked After You Disable USB Ports from the Command Line
Verification takes four checks: read the registry value, restart, plug in a spare drive, and look at Device Manager and the event log. A rule you have not tested with a real drive is only an assumption.
reg query HKLM\SYSTEM\CurrentControlSet\Services\USBSTOR /v Start
sc qc USBSTORThe first command should print Start with the data 0x4. The second shows the service configuration, where the start type reads 4 DISABLED when the block is active.
Verification checklist
0 of 5 completed
If you turned on Audit PNP Activity, Windows logs event 6416 each time it recognises a new external device. Microsoft documents that event, and its presence tells you the system saw the plug-in even when the block refused to mount it.
Avoid these
Common Mistakes When You Disable USB Ports from the Command Line
Most failed attempts come from five mistakes: no backup, the wrong control set, disabling a hub that carries the keyboard, testing with an already-mounted drive, and skipping the restart. Each has a simple prevention.
Do this
- Export the key before the change
- Edit CurrentControlSet, the active set
- Test with a drive that was never plugged in
- Restart, then test again
- Keep the reversing command in a text file
Not that
- Change values from memory with no backup
- Edit a numbered ControlSet that is not active
- Judge success from a drive that is already mounted
- Disable root hubs on a remote PC
- Apply to every PC on day one
Changing ControlSet001 and assuming it applies. CurrentControlSet is a pointer to the active set, and a forum thread on Windows 11 describes a user who edited several sets and still saw drives mount, which points to a second cause worth checking.
When it does not take
Troubleshooting: USB still works after the command
A drive that still mounts after Start is set to 4 usually points to one of four causes: it was mounted before the restart, it uses the UAS driver, it is a phone using the portable device stack, or a policy rewrote the value. Check them in that order.
| Problem | Likely cause | Fix |
|---|---|---|
| Drive still appears | Drive was mounted before restart | Restart, unplug, plug in again |
| Fast external SSD still works | UAS drive uses a separate driver | Use the Removable Storage policy and test |
| Phone files still open | Phones use the portable device stack | Enable the WPD Devices deny policies |
| Value is back to 3 | Another policy or tool resets it | Check device-management and security software |
| Keyboard stopped working | A hub or controller was disabled | Boot to Safe Mode, re-enable the device |
The full diagnostic walkthrough, with commands for each cause, is in USBSTOR Start value 4 but USB still works. If the keyboard itself went dead, jump to enabling USB ports from the command line.
Undo
How to Re-enable USB Ports Safely
To undo the USBSTOR change, run reg add with Start set to 3 from an elevated prompt, delete the Deny_All value if you wrote it, and restart. Do this on a machine you own or administer; on a managed PC, ask the administrator.
reg add HKLM\SYSTEM\CurrentControlSet\Services\USBSTOR /v Start /t REG_DWORD /d 3 /fThe device commands, the policy value and the keyboard-lockout case have their own page: how to enable USB ports from the command line.
Beyond the command
Is This Enough? What Else to Do After You Disable USB Ports from the Command Line
Blocking storage closes one door. It does not log attempts, does not stop a device posing as a keyboard, and has no password. Add auditing, standard accounts and, where drives must be used, encryption of the drive’s contents.
Logging and auditing USB device activity
Turn on the Audit PNP Activity subcategory and Windows writes event 6416 when it recognises an external device. Microsoft’s event reference also lists 6419 for a request to disable a device and 6420 and 6422 for a device that was disabled or enabled. Those events show who changed a device and when.
Passwords, standard accounts and drive encryption
The commands in this guide add no password. People ask on Microsoft’s forum whether Windows can put a password on USB ports, and the built-in options here do not. If the aim is to protect a drive’s contents instead, drive-level tools such as USB Secure’s password protection for USB drives take a different approach, and roundups like this list of USB password protection tools compare the field.
Where blocking software and reviews fit
Independent roundups such as this free USB blocking software list and this USB port locking tools review compare tools by feature, which helps if your needs outgrow the built-in commands.
Editorial pick
When commands are not enough: where USB Block fits
The commands above cannot give you a password-protected switch, an allow list you can edit on screen, or a report of blocked attempts. For those, we recommend USB Block’s blocking and allow-list features, our own product, with the limits listed below.
Based on the product’s documented features, USB Block blocks storage that appears as a drive, which its page lists as USB flash drives, external hard drives, SD cards, cameras and phones. It also covers CDs, DVDs, mapped network drives and non-system drives, lets you whitelist your own drives, asks for a password before an unauthorised device opens, and logs wrong-password attempts.
Installation needs administrator rights, and once installed the protection applies to every user on the PC.

- Windows only. The product page lists 32-bit and 64-bit Windows 10, 8 and 7 plus Windows Server 2008, 2012, 2016 and 2019. Windows 11 is not named on that page, so test before you rely on it.
- The page says USB Block is not antivirus.
- The page prints no price or trial terms.

Step by step
Software-Based USB Blocking Step-by-Step
Using a dedicated blocker takes six steps: download the installer from the official page, install it as administrator, set a password, tick the devices to block, authorise your own drives, and read the reports. The screens below follow the program’s documented tabs.
- Download the installer.Get it from the official NewSoftwares downloads page so the file is the vendor’s own build.
- Install with an administrator account.The product page states that administrator rights are required.
- Set a password.USB Block asks for one, and the page says it must be entered before an unauthorised device can be opened.
- Open Control Center and tick Block USB Devices.The description beside the switch reads “Stop unauthorized USB drives, external drives and memory cards.”
- Authorise your own drives.The Authorized Devices tab lists devices that work without a prompt.
- Review Reports and Logs.The tab records device activity, and the page says incorrect passwords are logged.

USB Block versus built-in commands versus endpoint management
| Feature | Registry command | Group Policy | USB Block | Defender for Endpoint device control |
|---|---|---|---|---|
| Password-protected switch | No | No | Yes, per product page | Managed through admin roles |
| Allow list of approved devices | No | By device ID | Yes, per product page | Yes |
| Activity reports | Only with audit policy | Only with audit policy | Reports and logs tab | Yes, in its console |
| Platform | Windows | Windows Pro, Enterprise, Education | Windows | Windows with Defender for Endpoint |
| Cost | Free | Included in editions | Paid, see store | Needs Defender for Endpoint |
| Verdict | Fastest for one PC | Best for managed groups | Best when you need a password and a log | Best when you already run Defender for Endpoint |
Reference
What USB Block does and does not do
USB Block is a Windows program that blocks storage devices, optical discs, network drives and non-system drives, with a whitelist and a password. It is a better fit for a shared PC than for a single locked-down kiosk image managed by policy.
Block storage devices
Flash drives, external disks, SD cards, cameras and phones that appear as drives.
Best for: shared PCs. Not ideal for: phones that use MTP, so test yours.
Whitelist your own drives
Approved devices work without a prompt.
Best for: one company drive. Not ideal for: large fleets managed centrally.
Password and logging
A password gates unauthorised devices and wrong attempts are logged.
Best for: homes and small offices. Not ideal for: audit trails sent to a central server.

Cost
Cost of USB Block: what the official page shows
The commands in this guide cost nothing. USB Block is paid software, and its product page shows a Buy Full Version button without printing a price or a trial length, so this guide does not either. Prices and license options are on the NewSoftwares store.
| Option | Cost | What you get | Limit |
|---|---|---|---|
| Registry or policy commands | $0 | Storage blocking on any edition | No password, no reports |
| USB Block | See store | Blocking, whitelist, password, logs | Windows only; Windows 11 not named on the page |
Is it worth paying? If the PC is yours alone, the commands are enough. If other people share it and have admin rights, a password and a log are the features that justify a purchase.

Decision guide
Which blocking method fits a home PC, a shared PC or an office
A single home PC needs only the registry command. A shared PC needs a password-protected tool or standard accounts. A managed office needs Group Policy or device management, with software as an extra layer where policy cannot reach.
| Situation | Recommended method | Does USB Block fit? | Honest alternative |
|---|---|---|---|
| One home PC, you are the only user | USBSTOR registry command | Not needed | Registry command |
| Family PC with several accounts | Standard accounts plus blocking | Yes, for the password | Group Policy on Pro |
| Office of 5 to 20 PCs | Group Policy or software | Yes, if PCs are not domain joined | Group Policy |
| Domain-joined fleet | Group Policy or device management | Rarely | Intune or Defender device control |
| Developers who need USB devices | Allow list by device ID | Partly | Install-restriction policies |
Common questions
Frequently asked questions about disabling USB ports from the command line
How to disable usb ports from the command line?
Open an elevated Command Prompt and run the reg add command that sets the USBSTOR service Start value to 4, then restart Windows. Storage drives stop mounting while keyboards and mice keep working. For phones, add the WPD Devices deny policies, because phones do not use the USBSTOR driver.
Can I disable usb ports from the command line without paid software?
Yes. Windows ships everything needed: reg add, PowerShell’s Set-ItemProperty and Disable-PnpDevice, and pnputil on Windows 10 version 2004 or later. Paid software only adds a password-protected switch, an allow list with a friendly screen, and activity reports. The built-in commands cost nothing and work offline.
What is the fastest way to disable usb ports from the command line?
Setting the USBSTOR start type is fastest: one reg add line, one restart, no editor to open. It takes under a minute on a PC you can reach. Group Policy is quicker for a hundred PCs, since you set it once and every machine in the group receives it.
What mistakes should I avoid when I disable usb ports from the command line?
Skipping the backup is the common one, followed by editing the wrong control set, disabling a USB root hub that carries your keyboard, and testing only with a drive that was already mounted. Export the key first, change one value, then test with a spare drive after a restart.
How do I check that it worked after I disable usb ports from the command line?
Run reg query on the USBSTOR key and confirm Start shows 0x4. Then restart, plug in a spare drive, and check that no drive letter appears in File Explorer. Device Manager normally lists the drive with a warning icon instead of a working disk entry.
Can I block USB storage but keep my keyboard and mouse working?
Yes, and the USBSTOR method does exactly that. It switches off only the mass-storage driver, so keyboards and mice, which use the HID class, are untouched. The risky choice is disabling a USB root hub or controller, which can cut off every device behind it, including your input devices.
Does blocking USB ports stop phone charging?
No. Charging comes from port power, and none of the storage commands in this guide cut it. A phone plugged in only to charge will still charge. What changes is file access: with the WPD Devices policies enabled, Windows will not let you browse the phone’s storage over USB.
Will USB blocking work on Windows Home?
The USBSTOR registry command works on Windows Home because it needs only the registry. The Local Group Policy Editor does not exist on Home, so the policy method has no editor there. Microsoft does not document whether Home enforces the policy key when you write it directly, so test it first.
How do I re-enable USB ports as the administrator?
Run reg add with Start set back to 3, delete the Deny_All value if you added it, and restart. Use an elevated prompt. If the keyboard is also dead, boot into the Windows recovery environment or Safe Mode and make the change from there.
Can I allow only one approved USB drive?
Yes, with device installation policies. You block devices no rule describes, then allow the approved drive by its device ID and allow keyboard, mouse and USB bus classes so input keeps working. Software with an allow list does the same job through a screen instead of policy settings.
Is it safe to edit the USBSTOR registry value?
It is safe when you back up first and change only the Start value. Microsoft’s own guidance warns that wrong registry edits can cause serious problems, so export the key to a .reg file before you begin. If something goes wrong, double-clicking the exported file restores the original.
Can I disable USB ports without administrator rights?
No. Every method here writes to protected registry keys or changes device state, and Microsoft’s documentation says Disable-PnpDevice needs an administrator account. A standard user cannot block USB on their own PC. On a work or school PC, ask whoever manages it.
Do these commands stop a USB device that pretends to be a keyboard?
No. A device that identifies itself as a keyboard uses the HID class, which the storage commands deliberately leave alone. Stopping that takes device installation policies that allow only known device IDs, or a physical measure such as locking the port. Storage blocking addresses data copying, not every USB attack.
More detail
In-depth answers on command-line USB blocking
Can you disable USB ports from the command line?
You can disable USB storage and chosen devices from the command line, but not the physical ports. Powering a port off is a firmware job, and the commands here act on drivers, policies and device entries.
That distinction explains most confusion. A drive blocked by the USBSTOR value still draws power from the port, so a phone still charges. If a literal power-off is the goal, look in BIOS or UEFI settings.
What is the easiest way to disable USB ports from the command line?
The easiest way is the single reg add line that sets USBSTOR Start to 4. It needs no editor, no extra download and no knowledge of device IDs.
Copy it from the step-by-step commands section, run it as administrator, and restart. The method fails quietly for UAS drives and phones, which the troubleshooting table covers.
Disable USB ports from the command line for free
Every command in this guide is free to run. The reg add, PowerShell and pnputil tools all come with Windows itself, so no download, account or licence is involved at any step.
Free methods carry no password and no reports. If those matter, compare them with the paid option’s documented features before buying.
Disable USB ports from the command line in 2026
The commands in this guide were checked against Microsoft documentation in November 2026 and apply to current Windows 10 and Windows 11 builds. Microsoft’s archived article on USB storage notes that newer management routes such as Intune are generally preferred in managed environments.
For a single PC, the registry value remains valid. For a company fleet, policy or device management is easier to audit.
USB Blocking Software
USB blocking software adds three things the commands lack: a password, an allow list with a screen, and logs. Programs differ on which Windows versions they support, so read the vendor’s list before installing.
Roundups rank tools by features, and they date quickly. Treat any ranking as a starting point and confirm the Windows version and licence terms on the vendor’s own page.
Block USB
To block USB on Windows means stopping a class of devices, one named device, or a whole port. The wording is loose, so decide first whether you mean storage, phones or everything.
Storage is the usual target. The class table above shows which command reaches which device.
Block USB Software
When you choose block USB software, check four things: the Windows versions it lists, whether it needs administrator rights to install, whether it keeps an allow list, and whether it logs attempts.
USB Block’s page documents all four except Windows 11 support, which it does not name. Ask the vendor or test on a spare PC before deploying.
Our verdict
Our verdict: use the USBSTOR value first, add software when you need a password and a log
For most readers, the USBSTOR registry command is the right first step: it is free, reversible and leaves input devices alone. When other people have admin rights, or you need a password, an allow list and logs, a dedicated program is the sensible next layer.
We make USB Block, so weigh that when you read our recommendation. The commands in this guide are a legitimate answer on their own, and we have said where they fall short.
Go deeper on a single problem
Go deeper
USBSTOR Start Value 4 But USB Still Works
Why a drive still mounts after the registry change, and what to check.
Read the guide →Enable USB Ports from the Command Line
The reverse commands, plus what to do if the keyboard stopped too.
Read the guide →Allow Only One Approved USB Drive
Build an allow list by device ID without locking out your keyboard.
Read the guide →This guide is published by the NewSoftwares.net team, the developer of USB Block. It covers free and built-in options alongside our own. Questions about the product can go to the developer through the contact page.