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.

Last verified: November 2026Windows 10 and 11Tested method order
USB port with a padlock above it and a row of password dots below

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.

Quick answer

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

At a glance: four ways to lock USB storage on Windows
MethodWindows editionsPassword promptApproved-drive list
USB Block (software)Windows 10, 8, 7 and Server, per its product pageYes, for unauthorized drivesYes, authorized devices
Group Policy: Deny all accessPro, Enterprise, EducationNo, admin account gates the changeNo
Registry: USBSTOR Start = 4All editionsNo, admin account gates the changeNo
Device Installation RestrictionsPro, Enterprise, EducationNoYes, 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.

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

  1. Sign in with an administrator account, press Win + R, type gpedit.msc and press Enter. Approve the User Account Control prompt.
  2. Open Computer Configuration, then Administrative Templates, System, Removable Storage Access.
  3. Double-click All Removable Storage classes: Deny all access, choose Enabled, then Apply and OK.
  4. Restart Windows. Do not test before this step.
  5. Plug in a drive that worked yesterday and confirm it is refused. This is your proof.
Flow from gpedit.msc through Administrative Templates to the Deny all access setting and a restart
The path to the setting in the Local Group Policy Editor.

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.

  1. Right-click Start and open Terminal (Admin) or Command Prompt (Admin).
  2. Back up the key with the command on the Backup first tab below.
  3. Run the USBSTOR command from the second tab. A value of 4 disables the storage driver.
  4. 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 /f

The ADMX template writes Deny_All as a number set to 1. Confirm that on a test PC before you copy it to others.

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

Edition note: Windows Home has no Local Group Policy Editor, so gpedit.msc will not open. The registry route works on Home, Pro, Enterprise and Education. Pro, Enterprise and Education add the policy editor and Device Installation Restrictions.

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.

Decision tree splitting Windows Home from Pro, with software for password prompts
Edition first, then the password question.

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

  1. Restart Windows with no USB drives attached.
  2. Plug in a drive that worked before and wait ten seconds.
  3. Open This PC and Disk Management (diskmgmt.msc). A blocked drive should be refused or absent.
  4. Repeat with a second drive from a different maker.
  5. Connect a phone in file-transfer mode and note whether its storage appears.
  6. Plug in a keyboard or mouse to confirm input devices still work.

Troubleshooting checklist

Tick each item as you confirm it.

Problem, cause, fix

Troubleshooting table: problem, cause and fix
ProblemLikely causeFix
A flash drive still opensThe restart is pending, or only the user copy of the policy is setRestart, then confirm the HKLM value or the Computer Configuration setting
A phone still copies filesFile-transfer mode uses the WPD class, which the removable-disk policies skipEnable the WPD Devices deny policies, restart and test your model
gpedit.msc will not openWindows Home has no Local Group Policy EditorUse the registry method from the step-by-step section
The setting reverts after a restartA domain policy is overwriting the local oneRun gpresult /r and change the domain policy instead
A keyboard stopped workingA device-installation rule was too wideUndo the rule, then allow keyboard and mouse classes before retrying
Start returns to 3The driver was never installed, or other software reset itRestart, 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

  1. Pilot the change on two PCs and restart both.
  2. Test one drive, one phone and one keyboard on each.
  3. Write the exception process: who approves a drive and how it is recorded.
  4. Link the policy to the target group and announce the restart window.
  5. Run gpresult on a sample PC to confirm the policy applied.
  6. 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.

Built-in methods against one software option
MethodWhere you set itScopeStops phonesPassword promptMain caveat
USB BlockInstalled programWhole PC, all usersLists phones that appear as drivesYes, on unauthorized drivesProduct page lists Windows 10, 8, 7 and Server only
Deny all access policyGroup PolicyComputer or user copyNot reliablyNoNeeds Pro or higher and a restart
Per-class deny policiesGroup PolicyRead, write or execute per classOnly with WPD policyNoEasy to miss a class
USBSTOR Start = 4RegistryWhole PCMay not stop phonesNoValue can revert if the driver was never installed
Device Installation RestrictionsGroup PolicyBy device ID or classDepends on ruleNoWide rules can block keyboards
Disable deviceDevice ManagerOne installed deviceNoNoDoes not cover the next drive
PC branching to four device types, flash drive, hard drive, keyboard and phone, with each result
What a storage block stops, and what it leaves alone.

USB device-class cheat sheet

Filter by device name or group. “Stopped” means the setting prevents use.

DeviceDriver familyUSBSTOR Start = 4Deny all removable classesNote
USB flash driveMass storageStoppedStoppedThe main target of both methods
External hard diskMass storageStoppedStoppedApplies to USB-attached disks
SD card in a USB readerMass storageStoppedStoppedBuilt-in SD slots may differ, so test
External DVD driveMass storage or CD and DVD classTest firstCovered by CD and DVD classCheck with a disc
Phone in file-transfer modeWPDMay not stop itNeeds WPD policyAdd WPD Devices deny read and write
Phone charging onlyPowerUnaffectedUnaffectedPower is not blocked
Keyboard and mouseHuman interfaceUnaffectedUnaffectedKeep working unless a wide rule catches them
USB printerPrinterUnaffectedUnaffectedDifferent driver
Webcam or headsetVideo or audioUnaffectedUnaffectedDifferent driver
USB network adapterNetworkUnaffectedUnaffectedA 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

  1. Download the installer from the official NewSoftwares.net download page. Installing needs administrator rights.
  2. Run the installer, open USB Block and set your password in the program settings. Note the Master Key option and store it safely.
  3. Open the Control Center tab and tick Block USB Devices. Optional switches cover discs and floppy drives, network access and non-system drives.
  4. Open Authorized Devices and add the drives you own, so they open without a password prompt.
  5. Plug in an unapproved drive and confirm the password prompt appears.
  6. Check Reports and Logs to see the allowed and blocked entries, and the invalid password attempts.
USB Block Control Center with switches for USB devices, discs, network access and non-system drives
Control Center: one switch per device group.
USB Block detailed summary screen listing status for USB devices, discs, network and non-system drives
The summary screen shows what is allowed and blocked.
USB Block Program Options with stealth mode, safe mode protection, master key and hack attempt monitoring
Program Options: stealth mode, safe mode and attempt monitoring.
USB Block window shown on a desktop monitor with its summary screen open
USB Block on a desktop PC, summary screen open.
Windows 11 note: USB Block’s official page lists Windows 10, 8, 7 (32-bit and 64-bit) and Windows Server 2008, 2012, 2016 and 2019. It does not mention Windows 11. The native methods earlier in this guide cover Windows 10 and 11.
USB Block software box shot with the Data Leak Prevention tagline
Editorial pick

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.

  1. Plug in the approved drive and open Device Manager. Find it under Disk drives.
  2. Open Properties, Details, and choose Hardware Ids. Copy the ID.
  3. Enable the allow-by-device-ID policy and paste the ID.
  4. Also allow the keyboard and mouse device classes, because the prevent rule reaches every device type.
  5. 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.

USB Block Authorized Devices tab with columns for serial number, device type and device name
The Authorized Devices tab in USB Block.

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.

  1. Sign in with an administrator account.
  2. In gpedit.msc, set All Removable Storage classes: Deny all access to Not configured.
  3. Run the Undo both snippet from the step-by-step section, or restore your saved .reg backup.
  4. Restart Windows and test with a known drive.
  5. 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.

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.

USB Secure software box shot with the Lock Files on USB Drives tagline

USB Secure

Password-protects a whole USB drive and runs from the drive.

See USB Secure →
Folder Lock 10 software box shot with a key icon

Folder Lock 10

Lockers and folder protection for Windows 11 and 10, 64-bit.

See Folder Lock 10 →
Copy Protect software box shot with the Intellectual Property Protection tagline

Copy Protect

Keeps media files from being copied to other drives without permission.

See Copy Protect →
Folder Protect software box shot with the Customized Data Security Solution tagline

Folder Protect

Password-protects folders, files, drives and programs on Windows.

See Folder Protect →