Block USB Storage but Keep Your Keyboard, Mouse and Approved Drives Working

You can block USB storage in Windows 11 and still use your keyboard, mouse and one or two approved drives, because input hardware and storage use different device classes. This page shows how to build the allow list on Windows 11 24H2, 25H2 and 26H2.

Editorial TeamNovember 20267 min readLast verified: November 2026

Quick answer

Storage-class rules never touch keyboards or mice. For approved drives, list the device IDs, then use Device Installation Restrictions on Pro or an authorize list in dedicated software. Never disable the USB controller, and add the keyboard, mouse and hub to the allow list before any broad prevent rule.

Keyboard and mouse tiles marked allowed beside a USB storage tile marked blocked
At a glance
Applies toWindows 11 24H2, 25H2 and 26H2
Time needed20 to 40 minutes
DifficultyModerate to hard
CostFree with policy; paid with software
Needs admin or internetAdministrator rights; no internet
Last verifiedNovember 2026

This page is part of our main guide to blocking USB ports in Windows 11. It covers exceptions: what must keep working while storage is denied.

The Allow-First Inventory: list what must work before you block

Before you enable any block, list every USB device that must keep working: keyboard, mouse, headset, printer, hub and any approved drive. Note its class and ID. Starting from the allow list means you decide who gets in, instead of discovering what you broke afterwards.

Funnel diagram: all USB devices pass a class check and an allow-list before access is granted Every USB deviceDevice class checkAllow-listStorage and phonesblocked by defaultKeyboards, mice andnamed drives pass
Devices pass a class check and an allow list before they are granted access.
Inventory worksheet: record each device before you block anything
DeviceClassWhere to find the IDAction
Keyboard and mouseHuman Interface DeviceDevice Manager > Properties > DetailsAllow by class or ID
Hub or dockUSB hubUniversal Serial Bus controllersAllow explicitly
Approved flash driveDisk driveHardware Ids or instance IDAllow by instance ID
PhonePortable devicePortable DevicesBlock data, allow charging

Why storage rules leave keyboards and mice alone

Windows treats a keyboard as a Human Interface Device and a flash drive as a disk, and the two classes load different drivers. A rule aimed at the disk class never reaches input hardware. The danger is the blunt tools: disabling a controller or blocking every new device.

Microsoft advises confirming the IDs of keyboards, mice and hubs before applying broad classes. That is the reason the inventory comes first. If you have a laptop, its built-in keyboard usually works regardless, which makes testing safer.

Common mistake

Enabling Prevent installation of devices not described by other policy settings with an empty allow list. Every new USB device, including a replacement keyboard, is refused until you add its ID.

Find the hardware ID of a device you want to allow

Device Manager shows every ID Windows uses for a device. Open the device's Properties, choose the Details tab, select Hardware Ids, and copy the first value. Use the device instance path when you need to allow one specific drive instead of every drive of that model.

Example format: hardware ID and instance path
# Hardware ID: matches every drive of this model
USB\VID_1234&PID_ABCD
# Instance ID: matches one physical drive by serial number
USB\VID_1234&PID_ABCD\0123456789ABCDEF

The values above only show the format. Paste the real strings from your own device exactly, because one wrong character means the entry never matches.

Allow only approved drives with Device Installation Restrictions

On Windows 11 Pro, Enterprise and Education, enable Prevent installation of devices not described by other policy settings, then enable Allow installation of devices that match any of these device IDs and list your keyboard, mouse, hub and approved drive. Microsoft documents this as its scenario for allowing only an authorized thumb drive.

  1. Open the policy folder

    In gpedit.msc go to Computer Configuration > Administrative Templates > System > Device Installation > Device Installation Restrictions.

  2. Enable the layered order of evaluation

    Turn on Apply layered order of evaluation for Allow and Prevent device installation policies across all device match criteria. Microsoft evaluates instance IDs first, then device IDs, setup classes and removable devices.

  3. Add the allow entries

    Enable the Allow installation of devices that match any of these device IDs setting and paste each ID. Use the instance ID setting for one specific drive.

  4. Add the broad prevent rule last

    Enable Prevent installation of devices not described by other policy settings, restart and test. Without the layered setting, Prevent policies override Allow by default.

Limit

These policies govern driver installation. A drive Windows already installed keeps working unless you remove it or use the option that also applies to matching installed devices.

Phones and cameras: charge, but no file access

To let phones charge without exposing files, enable the WPD Devices deny policies and leave the controller alone. The phone's own USB mode matters too: Charging only, with no file transfer, never exposes storage. Test with your own phone and cable, because hardware decides whether charging survives.

Approved drives with dedicated software

A dedicated tool keeps an authorize list you can edit from one window, with no device-ID hunting. The developer's USB Block page describes a password prompt for unauthorized devices, an Authorize List that works without a prompt, and logs of allowed devices and wrong-password attempts.

That is easier than hand-built policy for a household or small office, and it works on Windows Home. The trade-off is scope: the same page says it blocks devices that appear as storage drives and is not a general port or keyboard blocker. See the USB Block device allow-list for the full feature list.

To test it first, use the installer download hub.

USB Block Authorized Devices tab listing serial number, device type and device name
The Authorized Devices tab.

Native allow list or software list: which suits you

Choose Device Installation Restrictions when you manage Pro machines and are comfortable with device IDs. Choose software when you need Home support, a per-drive password prompt or simple reports. The table compares the two on the criteria that decide most real setups.

Allow-list approaches compared
CriterionDevice Installation RestrictionsDedicated software
EditionsPro, Enterprise, EducationAny, including Home
Adding a drivePaste its ID into the policyAdd it to the authorize list
Per-drive passwordNoPrompt for unknown devices
ReportingEvent logs onlyBuilt-in device and usage reports
Installed devicesUnaffected unless removedEnforced when the device appears
VerdictUse policy for managed Pro PCs and software for Home or when you want reports.

Not that

Allow a whole USB class because one drive needs access.

Do this

Allow the single instance ID and keep the rest of the class blocked.

Questions about keyboards and approved drives

These answers cover exceptions to a USB storage block: why a keyboard stopped working, how to find device IDs, choosing between model and serial matching, hubs and docks, replacement drives, and printers. Each starts with the direct answer.

A broad rule probably caught it. Disabling a USB controller or enabling Prevent installation of devices not described by other policy settings with no allow entries stops new input devices too. Undo that rule from another input path, then add the keyboard's hardware ID to the allow list before turning the rule on again.

Open Device Manager, right-click the drive under Disk drives or Universal Serial Bus controllers, choose Properties, then open the Details tab and select Hardware Ids from the Property list. Copy the line that begins with USB or USBSTOR. Microsoft's guidance lists the same route for looking up IDs.

Yes. A hardware ID matches every drive of that model, while a device instance ID includes the serial number and matches one physical drive. Microsoft's policies offer both, and its order of evaluation puts instance IDs above device IDs, so a specific instance entry beats a broad model entry.

Only if you also allow the hub. A hub is its own device with its own ID, and blocking it takes every device behind it. Add the hub and the dock to the allow list, or allow the Hub setup class, before you enable the prevent rule, and keep a spare keyboard handy.

The new drive is blocked until you add its ID, because the allow list names devices, not owners. Keep a short register of approved drives, add the replacement's ID before retiring the old one, and remove the old entry afterwards so a lost drive cannot be reused.

Yes. Printers and scanners use their own classes, so storage rules do not touch them. If you also use a prevent-everything rule, add the device's hardware ID or its setup class to the allow list first. Test printing after a restart, because some multifunction printers also present a memory-card reader as storage.

To try an authorize list without writing device-ID policy, download the free version and test it with your own approved drive.