Block USB Storage but Keep Keyboard and Mouse Working
A BIOS port switch turns ports off. A storage rule turns drives off. Only the second lets your keyboard and mouse carry on. This guide explains the device classes involved, three ways to block storage only, and a short test that proves you did not lock yourself out.
Block the storage class, not the port. Use the Group Policy deny rule for removable storage, set the USBSTOR Start value to 4 on Windows Home, or use blocking software. Keyboards and mice are input devices on a different driver, so they keep working. Test with a drive before you walk away.
| Goal | Stop drives and discs, keep keyboard and mouse |
|---|---|
| Methods | Group Policy, registry value, blocking software |
| Time needed | 5 to 15 minutes plus a test |
| Difficulty | Easy to moderate |
| Last verified | November 2026 |
Why a Port Switch Cannot Tell a Drive from a Keyboard
A port switch works on hardware: it turns the connector or its controller off, so everything plugged in goes dark. A device class rule works on identity. Windows asks what the device says it is, then applies a policy to that class. That is the difference that keeps input alive.
This is the root of most lockouts described in our recovery guide for dead USB input. When the goal is storage only, using the port switch is the wrong tool, because it cannot separate a keyboard from a flash drive.
The Device Class Map: What to Allow and What to Stop
The Device Class Map sorts USB gadgets into three groups: input devices to keep, storage devices to block and data-carrying gadgets to decide on. Keyboards and mice sit in the first group. Flash drives and external disks sit in the second. Phones, readers and printers need a decision.
| Device | Class | Default choice | Why |
|---|---|---|---|
| Keyboard, mouse | Input (HID) | Allow | Needed to use the PC |
| Flash drive, external disk | Mass storage | Block or allow-list | Main route for copying data |
| Phone in file mode | Portable device | Decide | Can carry files like a drive |
| Card reader | Mass storage | Block | Behaves like a drive |
| Printer | Printing | Allow | No storage role |
| Rule of thumb | Keep what you type with, stop what you copy to | Review the middle group yourself |
Three Ways to Block Storage Only
Three routes block storage while leaving input alone: the Group Policy rule All Removable Storage classes: Deny all access, the USBSTOR registry value set to 4, and blocking software. Choose by Windows edition and whether you need an approved-device list.
Group Policy (Pro, Enterprise, Education)
Open the Local Group Policy Editor, go to Computer Configuration, Administrative Templates, System, Removable Storage Access, and enable the deny-all rule. Restart so it applies.
Registry value (any edition)
Set the USBSTOR service Start value to 4 in the registry, restart, and test. The exact key and a copy-ready snippet are in the Windows methods section of the main guide.
Blocking software
Install a tool as an administrator, switch on the storage categories and add approved devices. USB Block's official page lists the categories it covers.
Do not apply registry edits you have not exported first. Back up the key, and test on a spare PC if you can.
The Lockout Test: Prove Input Still Works
Run a lockout test before you leave: restart the PC, confirm the keyboard and mouse work at sign-in, plug in a known flash drive and check that no drive letter appears, then confirm an approved device still works if you allowed one. If any step fails, undo the last change.
Edge Cases: Phones, Card Readers and Hubs
Edge cases decide whether a storage rule really holds. Phones set to file transfer can carry data like a drive, card readers present as storage, and hubs only pass devices through. Test each one you own, because behavior varies with the driver and the mode the device is set to.
For a short primer on how flash drives become a leak route, one independent write-up is this guide to USB flash drive security risks. For spotting infected drives, see the USB malware and data leak guide.
A storage rule does not stop devices that pose as keyboards. If that threat matters to you, add an allow-list by vendor and product ID.
Storage-Only Blocking Questions
These answers cover the details people check before relying on a storage-only rule: keyboard safety, phones, charging and Windows versions. Each begins with the direct reply and then states what to test so the result is something you have verified yourself.
Can I block USB storage and still use a USB keyboard?
Yes. Storage and input use different Windows drivers, so a storage deny rule or the USBSTOR value stops drives without touching keyboards or mice. Test by restarting and signing in with the keyboard before you rely on the change. If input ever fails, undo the last edit and check Device Manager for errors.
Does the USBSTOR registry value block phones too?
Not always. USBSTOR covers mass-storage devices, while phones in file-transfer mode often use a portable-device driver. Test your phone in each mode, and add a Group Policy or software rule for portable devices if it still connects. Test one device at a time so you know which driver is responsible.
Will blocking USB storage stop phone charging?
No. These rules block data access to storage, not power. A phone can still draw charge from the port. If you must stop charging as well, you need a physical measure or the manufacturer restricted modes where they exist. A charging phone with no drive letter shows the storage rule is working.
Does this work on Windows 11 and Windows 10?
Yes. Microsoft documents the same removable-storage policy path and the USBSTOR value for current Windows releases, but retest after a major feature update, because policy behavior can change between builds. Microsoft notes the setting does not take effect until the PC restarts. Try it on a spare machine first if you manage several PCs.
Want storage blocking with an allow-list?
USB Block stops drives and discs, lets you authorize your own devices and logs the attempts.