Block USB Storage Devices (Flash Drives) via Registry
Stop Windows from mounting USB flash drives and external disks by disabling the USBSTOR service.
01Command
$ reg add "HKLM\SYSTEM\CurrentControlSet\Services\USBSTOR" /v Start /t REG_DWORD /d 4 /f02What it does
Setting the USBSTOR service Start value to 4 (Disabled) makes Windows ignore mass-storage devices — plugging in a flash drive or external hard disk simply does nothing, while keyboards, mice, and other USB gear keep working. This is a common lockdown for shared or front-desk PCs where people shouldn't copy files to or from a stick. Setting the value back to 3 (Manual/On demand) restores normal behavior.
03Risk
04Undo
$ reg add "HKLM\SYSTEM\CurrentControlSet\Services\USBSTOR" /v Start /t REG_DWORD /d 3 /f05Sources
- Policy CSP - Storage | Microsoft LearnEvidence: Documents Microsoft's storage policies such as RemovableDiskDenyRead/Write used to block USB storage access on Windows.
- REG - Add, modify and delete registry entriesEvidence: Documents the reg add command syntax for changing registry values such as the USBSTOR service Start value.
Last verified: 2026-09-18 · Category: Security & Privacy
06Related solutions
Understand PowerShell's execution policy scopes and set the one that lets you run your own local scripts without gutting the security model.
Two-step command sequence that makes you the owner of a locked file tree and grants yourself full control — the standard fix for 'Access is denied' on old profiles and OS reinstall leftovers.
Built-in Windows command to compute MD5, SHA1 or SHA-256 hashes of any file.