Home
How to Lock USB Ports with a Password: Step-by-Step Guide 2026
Windows has no password prompt for USB ports. Its built-in switches turn USB storage off for everyone, and your administrator account is the only lock on that switch. This guide shows both native routes for Windows 10 and 11, then the software route that adds a real password dialog.
How to Lock USB Ports with a Password: Quick Answer
Short answer: Windows can switch USB storage off with one Group Policy setting or one registry value, but neither asks for a password. Your administrator account is the gate. A password prompt for unapproved drives comes from software such as USB Block.
Windows 10 and 11 show no password box when a drive is plugged in. You can switch USB storage off with one Group Policy setting (Pro, Enterprise, Education) or one registry value (every edition), and only an administrator can switch it back on. A password prompt for unapproved drives needs software.
You need:
- An administrator account on the PC
- Your Windows edition, from Settings, System, About
- Time for one restart
- A spare USB drive for testing
- The rollback snippet saved somewhere that is not a USB drive
At a glance
| Method | Windows editions | Password prompt | Approved-drive list |
|---|---|---|---|
| USB Block (software) | Windows 10, 8, 7 and Server, per its product page | Yes, for unauthorized drives | Yes, authorized devices |
| Group Policy: Deny all access | Pro, Enterprise, Education | No, admin account gates the change | No |
| Registry: USBSTOR Start = 4 | All editions | No, admin account gates the change | No |
| Device Installation Restrictions | Pro, Enterprise, Education | No | Yes, by device ID |
Last verified: November 2026. Keyboards, mice, printers and charging keep working under every method listed here.
The Gate, Class, Proof method
Every step in this guide answers one of three questions. Gate: who may change the setting? Class: which kind of device does it stop? Proof: how do you know it works? Skip any one and you end up with a lock that looks fine and still lets a drive through.
What are you trying to do?
Pick the job and get pointed to the right section.
Start with the step-by-step section. It gives the Group Policy route for Pro and the registry route for every edition, then a rollback you can paste.
Go to the verification section for a seven-point checklist and a problem, cause and fix table. If a drive still opens, the dedicated page on drives that still work after blocking goes deeper.
Open the methods table to compare six approaches by scope, phones and password behaviour. For costs, read the free versus paid page.
Jump to the re-enable section. It lists the exact reverse steps for each method, written for the owner or administrator of the PC.
Step-by-Step: Lock USB Ports with a Password
Windows 10 and 11 give you two native routes, a Group Policy setting and a registry value, and both end with a restart. Neither shows a password box, so the first job is to decide who holds the administrator login.
Gate: your administrator account is the password
Changing a machine-wide policy or a service value needs administrator rights, and Windows asks that account to confirm through the User Account Control prompt. In the native methods, that sign-in is the only password involved.
Two chores follow. Give the administrator account a long, unique password, and move everyday users to standard accounts. A standard user cannot write to the machine-wide policy keys, so the block stays in place.
Class: Group Policy on Windows Pro, Enterprise and Education
- Sign in with an administrator account, press Win + R, type
gpedit.mscand press Enter. Approve the User Account Control prompt. - Open Computer Configuration, then Administrative Templates, System, Removable Storage Access.
- Double-click All Removable Storage classes: Deny all access, choose Enabled, then Apply and OK.
- Restart Windows. Do not test before this step.
- Plug in a drive that worked yesterday and confirm it is refused. This is your proof.
The same policy also exists under User Configuration, where Microsoft lists it as a separate setting. Use the Computer Configuration copy so the block covers every account on the PC. Microsoft’s documentation says the all-classes setting takes precedence over the single-class ones, so you do not need to set both. A Microsoft Tech Community answer adds that the policy does not take hold until Windows restarts.
Class: registry method for every edition
The USBSTOR service has a Start value of 3 by default, which lets the driver load when a storage device connects. Setting it to 4 disables the driver, so flash drives and external disks stop mounting.
- Right-click Start and open Terminal (Admin) or Command Prompt (Admin).
- Back up the key with the command on the Backup first tab below.
- Run the USBSTOR command from the second tab. A value of 4 disables the storage driver.
- Restart, then test with a known drive and a second drive.
Microsoft’s knowledge base article on this value says it applies when a USB storage device has already been installed on the PC, and ComputerHope reports that the value can return to 3 if the driver was never installed. Confirm the result after a restart instead of assuming it held.
Copy-paste snippets
Highlighted for reading, one click to copy. Run from an elevated prompt.
REM Same value the Group Policy setting writes (needs a restart)
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\RemovableStorageDevices" /v Deny_All /t REG_DWORD /d 1 /fThe ADMX template writes Deny_All as a number set to 1. Confirm that on a test PC before you copy it to others.
REM Disable the USB storage driver (3 = enabled, 4 = disabled)
reg add HKLM\SYSTEM\CurrentControlSet\Services\USBSTOR /v Start /t REG_DWORD /d 4 /fRun it from an elevated Command Prompt, then restart.
REM Re-enable the driver
reg add HKLM\SYSTEM\CurrentControlSet\Services\USBSTOR /v Start /t REG_DWORD /d 3 /f
REM Remove the policy value
reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\RemovableStorageDevices" /v Deny_All /fRestart after running both lines.
REM Save the current driver key before you change it
reg export HKLM\SYSTEM\CurrentControlSet\Services\USBSTOR C:\usbstor-backup.reg /yDouble-click the saved file as an administrator to restore the old values.
Device Manager: one installed device at a time
Right-click a drive in Device Manager and choose Disable device, and that single installed device stops working. It is not a class-wide setting, so the next drive that someone plugs in installs fresh. Use it to shut off one known device, not to lock the port.
Home versus Pro: what changes
Admin rights and rollback
Before you block anything, write down the undo steps and keep a second administrator account that you have tested. Store the rollback snippet in a note on the PC itself, because after the block, the installer you meant to fetch on a USB stick will no longer open.
Best Free Methods to Lock USB Ports with a Password
Three methods cost nothing beyond the Windows license you already own: a Group Policy setting, a registry value and a per-device switch in Device Manager. The picker below matches one to your edition, your PC count and your goal.
Method picker
Answer three questions to see which native method fits.
Use the registry value
Open an elevated Command Prompt, set USBSTOR Start to 4, restart and test. Home has no Group Policy Editor, so the registry is the native route. Save the undo line (Start back to 3) before you begin.
Repeat the registry change per PC
Home PCs cannot take a domain policy, so you apply the registry change on each machine or push a saved .reg file with your device-management tool. Pilot on two PCs, restart both, then roll out.
Use the Local Group Policy Editor
Open gpedit.msc, go to Computer Configuration, Administrative Templates, System, Removable Storage Access, and enable All Removable Storage classes: Deny all access. Restart, then test.
Link a Group Policy Object
Enable the same setting in a domain policy linked to the organizational unit that holds the PCs. Pilot on one unit, run gpupdate, restart a sample PC and check it with gpresult.
Use Device Installation Restrictions
Allow the hardware ID of each approved drive, allow keyboard and mouse classes, then prevent installation of devices not described by other settings. Test on a spare PC, because the last rule reaches every device type.
Native allow-lists need Pro
Home has no Group Policy, so a built-in approved-drive list is not available. USB Block keeps an authorized-devices list: your own drives open without a prompt and others ask for the password. Its product page lists Windows 10, 8 and 7.
Add the WPD Devices policies
In Removable Storage Access, deny read and write for WPD Devices. Microsoft Q&A moderators point to these for phones in file-transfer mode, because the removable-disk policies do not cover them. Test your own phone after a restart.
Test before you trust it
The USBSTOR value may not stop a phone in file-transfer mode, because phones use a different driver path from storage drives, and Home lacks the WPD policy editor. Test your phone after the change.
What the free methods do not cover
None of the native methods asks anyone for a password. None keeps a list of which drives were allowed, and on Home there is no approved-drive rule at all. Microsoft’s own Q&A guidance on this question says a port cannot be password-protected in hardware, only controlled in software, and it names USB Block among the tools that prompt for a password on unauthorized drives. See that Microsoft Q&A thread for the discussion.
If you want a side-by-side of no-cost tools and paid ones, read the free versus paid page.
Common Mistakes When You Lock USB Ports with a Password
Six slips cause most failed attempts: no restart, the wrong policy scope, phones left uncovered, no rollback note, a mounted test drive and a shared administrator login. Each one is cheap to fix when you know where to look.
Skipping the restart
The Deny all access policy does not apply until Windows restarts. People test right after clicking OK, see the drive open and decide the setting failed.
Editing the wrong scope
User Configuration and Computer Configuration hold separate copies of the policy. Changing only the user copy protects one account.
Expecting phones to be covered
Phones in file-transfer mode use the WPD class. The removable-disk policies do not reach them, so a phone can still copy files.
Losing your own way back
Block storage before you save the undo commands and the installer you wanted on a USB stick will not open. Write the rollback down first.
Testing with a mounted drive
A drive that Windows mounted earlier can look fine in the same session. Restart, then test with a drive that was unplugged during the restart.
Sharing the admin login
If three people know the administrator password, the block is only as strong as the least careful of them. Give each administrator a named account.
How to Verify It Worked After You Lock USB Ports with a Password
Verification takes five minutes: restart, plug in a drive that worked before, try a second drive, try a phone, then confirm a keyboard still types. If any storage device opens, the table below maps the symptom to its cause.
Proof test in six steps
- Restart Windows with no USB drives attached.
- Plug in a drive that worked before and wait ten seconds.
- Open This PC and Disk Management (
diskmgmt.msc). A blocked drive should be refused or absent. - Repeat with a second drive from a different maker.
- Connect a phone in file-transfer mode and note whether its storage appears.
- Plug in a keyboard or mouse to confirm input devices still work.
Troubleshooting checklist
Tick each item as you confirm it.
Problem, cause, fix
| Problem | Likely cause | Fix |
|---|---|---|
| A flash drive still opens | The restart is pending, or only the user copy of the policy is set | Restart, then confirm the HKLM value or the Computer Configuration setting |
| A phone still copies files | File-transfer mode uses the WPD class, which the removable-disk policies skip | Enable the WPD Devices deny policies, restart and test your model |
| gpedit.msc will not open | Windows Home has no Local Group Policy Editor | Use the registry method from the step-by-step section |
| The setting reverts after a restart | A domain policy is overwriting the local one | Run gpresult /r and change the domain policy instead |
| A keyboard stopped working | A device-installation rule was too wide | Undo the rule, then allow keyboard and mouse classes before retrying |
| Start returns to 3 | The driver was never installed, or other software reset it | Restart, recheck the value, and remove tools that manage the same key |
For a longer walk through persistent cases, see the page on drives that still work after blocking.
Is This Enough? What Else to Do After You Lock USB Ports with a Password
No. A storage block closes one route for data to leave or malware to arrive, but email, cloud uploads, network shares and rogue keyboards remain. Add a rollout plan, some logging and a written policy so the lock survives staff changes.
Multi-PC rollout checklist
- Pilot the change on two PCs and restart both.
- Test one drive, one phone and one keyboard on each.
- Write the exception process: who approves a drive and how it is recorded.
- Link the policy to the target group and announce the restart window.
- Run gpresult on a sample PC to confirm the policy applied.
- File the rollback commands and the date of the change.
Logging and audit
Native Windows tools give you scattered device events, not one report of allowed and blocked drives. USB Block’s official page says its logs record which device was allowed and when, and that wrong password attempts are logged too, and its screenshots show a Reports and Logs tab holding the last 100 entries.
Shared, school and kiosk PCs
On a PC that many people touch, use standard accounts for everyone, keep one named administrator, and lock the physical room if you can. Stealth Mode in USB Block hides its shortcuts from the Start Menu, Desktop and Control Panel, so write its hotkey and password down before you enable it.
Office policy generator
Draft an office USB policy
Fill in the fields and copy the text into your handbook.
Why Block USB Ports at All
Three risks justify a storage block: a stray drive carrying malware, a staff member copying records out, and a well-meaning colleague plugging in an unknown stick. A block removes the easiest path for all three.
Autorun malware and unknown drives
Modern Windows does not launch programs from a USB drive by itself, but people still open files on drives they were handed. Shortcut files and booby-trapped documents rely on that single double-click. A storage block removes the drive from the picture.
Insider risk and whitelisting
Copying files to a flash drive is the quickest way for data to leave an office. Blocking storage by default and allowing a short list of approved drives keeps that route open for the few who need it, and closed for everyone else.
This guide is written for owners and administrators securing their own equipment. Do not use these methods to restrict a PC you do not own or manage.
Risk score card
Tick every statement that is true for the PC or office you manage.
Score: 0 of 100 ·
Built-in Windows Methods Compared
Five native approaches differ mainly in scope: Group Policy covers a computer or user, the registry covers the whole PC, Device Installation Restrictions work by device ID, and Device Manager touches one device. Only software adds a password prompt.
| Method | Where you set it | Scope | Stops phones | Password prompt | Main caveat |
|---|---|---|---|---|---|
| USB Block | Installed program | Whole PC, all users | Lists phones that appear as drives | Yes, on unauthorized drives | Product page lists Windows 10, 8, 7 and Server only |
| Deny all access policy | Group Policy | Computer or user copy | Not reliably | No | Needs Pro or higher and a restart |
| Per-class deny policies | Group Policy | Read, write or execute per class | Only with WPD policy | No | Easy to miss a class |
| USBSTOR Start = 4 | Registry | Whole PC | May not stop phones | No | Value can revert if the driver was never installed |
| Device Installation Restrictions | Group Policy | By device ID or class | Depends on rule | No | Wide rules can block keyboards |
| Disable device | Device Manager | One installed device | No | No | Does not cover the next drive |
USB device-class cheat sheet
Filter by device name or group. “Stopped” means the setting prevents use.
| Device | Driver family | USBSTOR Start = 4 | Deny all removable classes | Note |
|---|---|---|---|---|
| USB flash drive | Mass storage | Stopped | Stopped | The main target of both methods |
| External hard disk | Mass storage | Stopped | Stopped | Applies to USB-attached disks |
| SD card in a USB reader | Mass storage | Stopped | Stopped | Built-in SD slots may differ, so test |
| External DVD drive | Mass storage or CD and DVD class | Test first | Covered by CD and DVD class | Check with a disc |
| Phone in file-transfer mode | WPD | May not stop it | Needs WPD policy | Add WPD Devices deny read and write |
| Phone charging only | Power | Unaffected | Unaffected | Power is not blocked |
| Keyboard and mouse | Human interface | Unaffected | Unaffected | Keep working unless a wide rule catches them |
| USB printer | Printer | Unaffected | Unaffected | Different driver |
| Webcam or headset | Video or audio | Unaffected | Unaffected | Different driver |
| USB network adapter | Network | Unaffected | Unaffected | A separate network policy applies |
Software-Based USB Blocking Step-by-Step
USB Block works at the PC rather than the Windows policy layer: install it, set a password, switch on the USB block, then authorize your own drives. Unapproved drives prompt for the password, and the program logs the attempt.
Step by step
- Download the installer from the official NewSoftwares.net download page. Installing needs administrator rights.
- Run the installer, open USB Block and set your password in the program settings. Note the Master Key option and store it safely.
- Open the Control Center tab and tick Block USB Devices. Optional switches cover discs and floppy drives, network access and non-system drives.
- Open Authorized Devices and add the drives you own, so they open without a password prompt.
- Plug in an unapproved drive and confirm the password prompt appears.
- Check Reports and Logs to see the allowed and blocked entries, and the invalid password attempts.





Our verdict: use USB Block when you need a real password prompt
It is the only method in this guide that asks for a password when an unapproved drive appears, and it runs on Windows Home because it does not rely on Group Policy. Its listed systems are Windows 10, 8, 7 (32-bit and 64-bit) and Windows Server 2008, 2012, 2016 and 2019. Windows 11 is not on that list, so confirm support on the USB Block product page before you buy for a Windows 11 PC.
The NewSoftwares store showed USB Block at $49.95, one time, when we checked in November 2026. The product page does not state trial terms or how many PCs a license covers, so read the download and store pages first.
How to Allow Approved Drives Only
An approved-drive rule flips the default: everything is blocked except devices you name. Pro editions can do this by hardware ID in Device Installation Restrictions, and USB Block does it with an authorized-devices list.
Native allow-list on Pro and Enterprise
Under Computer Configuration, Administrative Templates, System, Device Installation, Device Installation Restrictions, Microsoft provides settings named Allow installation of devices that match any of these device IDs and Prevent installation of devices not described by other policy settings. Read the details in Microsoft’s removable storage policy reference before you start.
- Plug in the approved drive and open Device Manager. Find it under Disk drives.
- Open Properties, Details, and choose Hardware Ids. Copy the ID.
- Enable the allow-by-device-ID policy and paste the ID.
- Also allow the keyboard and mouse device classes, because the prevent rule reaches every device type.
- Enable the prevent rule for devices not described by other settings, restart and test on a spare PC first.
A hardware ID names a model, so two drives of the same model share it. Some drives report no unique serial number, which limits how finely you can separate them.
Authorized devices in USB Block
USB Block’s Authorized Devices tab lists the drives you approved, with a Remove from List button to withdraw one. The product page says unapproved drives then ask for the password. This is the simpler route on Windows Home, where no native allow-list exists.

How to Re-enable USB Ports Safely
Reversing a block takes four edits on a PC you own: set the policy back to Not configured, return Start to 3, remove the Deny_All value and restart. Software like USB Block reverses from inside its own Control Center with your password.
- Sign in with an administrator account.
- In gpedit.msc, set All Removable Storage classes: Deny all access to Not configured.
- Run the Undo both snippet from the step-by-step section, or restore your saved .reg backup.
- Restart Windows and test with a known drive.
- For USB Block, open the Control Center with your password and clear the Block USB Devices switch.
If you have lost the USB Block password, its Program Options screen lists a Master Key feature, so look for the key you stored at setup. When both are gone, contact the developer through the footer link; do not look for ways around a lock on a PC that is not yours.
Lock Folder with Password
Port locks protect the PC. A folder password protects the files themselves, and Windows has no built-in folder password. Encrypting File System is missing on Home, and BitLocker needs Pro or higher.
The practical options are an encrypted archive such as 7-Zip, a container like VeraCrypt, a BitLocker virtual disk, or a locker program such as Folder Lock’s password protection. The dedicated page compares them by edition: lock a folder with a password on Windows.
Folder Password Lock
A folder password lock either hides a folder or encrypts its contents, and the difference matters. Hiding stops casual browsing; encryption stops someone who finds the files. Pick the level before you pick the tool.
The levels run from hiding, through a password-protected archive, to an encrypted container and locker software. Read the folder lock levels to match your threat to a level.
USB Password Software
USB password software comes in two kinds: tools that lock one drive, and tools that control which drives a PC accepts. The first travels with the stick; the second lives on the computer.
USB Secure password-protects the whole drive and runs from the drive itself, according to its official page, while USB Block controls the PC. The page called USB password software, drive or port gives a two-question test to choose.
USB Lock Software
Search results for USB lock software mix free utilities, trial downloads and paid suites, and the labels are not always accurate. What matters is whether the tool asks for a password, keeps an approved list and logs attempts.
A four-rung ladder, from built-in settings up to software with a password prompt, is laid out on the free versus paid page. It also lists what each rung costs in time or money.
Frequently Asked Questions
Fourteen common questions about locking USB ports on Windows, with short answers. Use the chips to narrow the list by device, app, file type or platform.
Showing 14 of 14 questions
Windows cannot ask for a password at the port itself. The closest native route is a Group Policy or registry switch that turns USB storage off, with your administrator account acting as the password for changing it. For a real password prompt on unapproved drives, you need software such as USB Block. The native steps work on Windows 10 and 11.
Partly. Group Policy and the registry cost nothing and block USB storage for every user, but they ask for no password. Only an administrator account can reverse them. A true password prompt needs software, and the product pages we checked do not state trial terms. The free-versus-paid page compares the options.
On any edition, one registry command sets the USBSTOR service to disabled, and a restart finishes the job. It takes a few minutes. On Pro, the Group Policy setting named Deny all access is just as quick and simpler to undo. Neither adds a password prompt, so treat your administrator account as the lock.
The usual four are skipping the restart, editing User Configuration when you meant Computer Configuration, expecting phones to be covered by the storage policy, and testing with a drive that was already mounted. The mistakes section above gives the fix for each, plus two more that cause lockouts.
Restart, then plug in a drive that worked before. It should be refused or never appear in This PC. Try a second drive and a phone in file-transfer mode, and confirm that a keyboard still types. If anything opens, use the checklist and the troubleshooting table in the verification section.
Yes. Both native methods target USB storage only. The USBSTOR value and the removable storage policies leave keyboards, mice, printers and webcams alone because those devices use other drivers. A device-installation rule that is too wide can catch them, so test any rule that covers more than storage.
No. Charging draws power through the port, and none of these settings cut power. A phone in file-transfer mode may still reach its storage unless you also set the WPD Devices policy, so test your own model. The device table in this guide shows what each setting affects.
The Group Policy Editor is missing on Home, but the registry method works on every edition, Home included. USB Block also runs without Group Policy, according to its product page, though that page lists Windows 10, 8 and 7 and does not mention Windows 11. Match the method to your edition.
Sign in as an administrator, set the Group Policy to Not configured or the Start value back to 3, remove the Deny_All value if you added it, and restart. For USB Block, open the Control Center with your password and switch the block off. Keep the rollback snippets from this guide in a safe note.
Yes, with the right tool. On Pro and Enterprise, Device Installation Restrictions can allow one device ID and prevent everything else, but test first because that rule can catch keyboards too. USB Block keeps an authorized-devices list, so your own drive opens freely while others ask for the password.
No. A device that presents itself as a keyboard uses the human-interface driver, which storage settings never touch. Defending against that calls for rules that allow only known hardware IDs, or for physical control of the ports. Treat the storage block as one layer in a larger plan.
These steps are written for Windows. USB Block’s product page lists Windows versions only, and the registry and Group Policy paths here do not exist on other systems. For a Mac or Linux machine, check the documentation of your device-management tool or the operating system vendor.
Usually, when the reader shows the card as a removable disk. A USB card reader behaves like any other storage drive. Built-in SD slots on some laptops connect through a different path, so test with a real card before you depend on the block in a shared room.
Yes. The Removable Disks: Deny write access policy leaves reading on and blocks writing. It suits staff who must open a supplier’s drive but should not copy company files out. Test with one drive you can edit and one you cannot, so you see both outcomes before rollout.
Next Steps
Pick the follow-up that matches where you are: compare tools by cost, protect the folders on the PC, choose between drive and port software, or work through a block that is not holding.
- Free versus paid USB lock software for a cost-of-control comparison.
- Lock a folder with a password for file-level protection.
- USB password software for the drive-or-port test.
- USB still works after blocking for stubborn cases.
More Tools from NewSoftwares.net
USB Block is one of several security programs from NewSoftwares.net. These four sit next to it: two for USB drives and folders, two for files and media, each with its own official product page.

Copy Protect
Keeps media files from being copied to other drives without permission.
See Copy Protect →

