See Our Top Pick →
Open padlock beside a terminal command that sets the USBSTOR start type back to 3 and a USB drive with a check mark> reg add ...USBSTOR /v Start /d 3 /fRestart, then test.Admin prompt requiredTest with a spare drive

Enable USB Ports from the Command Line: Commands and Keyboard Recovery

Re-enabling USB depends on how it was disabled. A registry value, a policy entry and a disabled device each have their own undo. This page lists them in the order most people need them, and covers the awkward case where the keyboard stopped too.

NewSoftwares.net editorial teamPublished November 2026Last verified: November 20267 min read
Quick answer

Set the USBSTOR Start value back to 3, delete the Deny_All policy value if present, and restart. For a single disabled device, run pnputil /enable-device with its instance ID. If the keyboard is dead, make the change from Safe Mode or the recovery command prompt.

First, find the cause

Match the undo to the way USB was disabled

There is no single enable command, because there is no single disable command. Identify which layer is active, then reverse that layer. Reversing the wrong one leaves the block in place and wastes a restart.

Undo by method
How it was blockedWhat to runRestart?
USBSTOR Start = 4reg add ... /v Start /d 3Yes
Deny_All policy valuereg delete ... /v Deny_All /fYes
Device disabled with pnputilpnputil /enable-deviceUsually no
Device disabled in Device ManagerEnable device from its menuNo
Port off in BIOS or UEFIFirmware setup screenYes
Third-party softwareThat program’s unlock routeDepends

Not sure which applies? Run the checks below. They only read values, so they are safe at any time.

Command Prompt (admin)
reg query HKLM\SYSTEM\CurrentControlSet\Services\USBSTOR /v Start
reg query "HKLM\SOFTWARE\Policies\Microsoft\Windows\RemovableStorageDevices"
pnputil /enum-devices /disabled

The first line shows the driver start type, the second lists any removable-storage policy values, and the third lists devices currently disabled.

The commands

Reverse each method with one command

Each reversal is a single line. Run it from an elevated prompt, restart where the table says to, and finish with a spare-drive test to prove the port works again.

Restore the USBSTOR driver

Command Prompt (admin)
reg add HKLM\SYSTEM\CurrentControlSet\Services\USBSTOR /v Start /t REG_DWORD /d 3 /f

The value 3 is the default, meaning the driver starts on demand. PowerShell equivalent:

PowerShell (admin)
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\USBSTOR" -Name "Start" -Value 3

Remove the removable-storage policy value

Command Prompt (admin)
reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\RemovableStorageDevices" /v Deny_All /f
gpupdate /force

If Group Policy or a management tool sets the value, it can return at the next refresh. In that case the fix belongs where the policy is defined.

Bring back a disabled device

Command Prompt (admin)
pnputil /enum-devices /disabled
pnputil /enable-device "<instance ID from the list>"
PowerShell (admin)
Get-PnpDevice -PresentOnly | Where-Object Status -eq 'Error'
Enable-PnpDevice -InstanceId '<instance ID>' -Confirm:$false

Microsoft’s documentation says Disable-PnpDevice and its enable counterpart need an administrator account, which is why standard users cannot reverse these changes.

The awkward case

When the keyboard and mouse stopped working too

Losing the keyboard usually means a USB controller or root hub was disabled, not that storage was blocked. Fix it from outside the running system: Safe Mode, or the recovery command prompt with the system registry loaded offline.

Reversal path from Start equals 4, through a command that sets Start to 3, to a restart that loads the driverBlockedStart = 4CommandStart = 3RestartDriver loads
Recovery paths when local input is gone.

Try the easy routes first

Offline registry edit from the recovery command prompt

Boot to the Windows recovery environment, open Command Prompt, and find the Windows drive letter first. It is often not C: in recovery.

Recovery Command Prompt
reg load HKLM\OFFSYS D:\Windows\System32\config\SYSTEM
reg add HKLM\OFFSYS\ControlSet001\Services\USBSTOR /v Start /t REG_DWORD /d 3 /f
reg unload HKLM\OFFSYS

Replace D: with the letter that holds your Windows folder. Writing to the wrong drive changes nothing useful, and the keyboard stays dead.

A disabled controller needs a different fix: boot to Safe Mode and re-enable it in Device Manager, or use the device commands above once any input works. The same rule applies on this site’s mistakes list: never disable root hubs on a PC you cannot reach.

Finish properly

Test the result before you walk away

Plug in a spare drive, confirm it appears in File Explorer, and check that keyboard, mouse and any phone connections respond. A short test now beats a surprise during the next meeting.

  1. RestartUse Restart so the driver set reloads.
  2. Plug in a driveIt should receive a drive letter within seconds.
  3. Check Device ManagerNo warning icons under Disk drives or Universal Serial Bus controllers.
  4. Re-block if neededIf this was a test, the blocking commands are on the main guide.

If the drive still refuses to mount after you reversed everything, the reverse of the common problem applies: see why USB behaves differently from the setting for how to read which driver owns the device.

Next step

Want a switch instead of a registry edit?

Typing commands each time is slow. A program with a password-protected on and off switch makes the same change in a click, and logs attempts.

When a built-in command is not enough, our own tool, USB Block, adds a password and an allow list. Our editorial pick and its limits are laid out in the recommendation section on the main guide.

Get USB Block → Back to the main guide

Common questions

Questions about enabling USB from the command line

How do I enable USB ports from the command line?

Open an elevated Command Prompt and run reg add with the USBSTOR Start value set to 3, delete the Deny_All value if you wrote one, and restart. For a single disabled device, pnputil /enable-device or Enable-PnpDevice brings it back without a restart in most cases.

My keyboard stopped working. How do I fix it without typing?

Boot into the Windows recovery environment or Safe Mode and make the change there. If no USB keyboard works, a PS/2 keyboard, a touch screen, or an on-screen keyboard in recovery may still accept input. The offline registry steps on this page work from the recovery command prompt.

Which command re-enables a device I disabled with pnputil?

Use pnputil /enable-device with the same instance ID you disabled, or Enable-PnpDevice in PowerShell. List devices first with pnputil /enum-devices to find the ID, including disabled ones, since a disabled device still appears in that list.

Do I need to restart after enabling USB again?

Restart after changing the USBSTOR value or deleting the policy value, because the driver set loads at start. Device-level enables usually take effect immediately without one. When in doubt, restart once and test with a spare drive to be sure.

What if USB Block or another tool locked the ports?

Use that tool’s own unlock or uninstall route with its password, instead of editing the registry underneath it. Software that enforces its own rule may reapply it, so a manual registry fix can be undone at the next start of the program.

Can a standard user enable USB again?

No. Every method here needs administrator rights, so a standard account cannot undo a block set by an administrator. On a managed work or school PC, ask whoever controls the policy to change it for you, or to approve an exception.