How to Enable USB Write Protection Using Regedit
This guide explains how to enable write protection on all connected USB flash drives in Windows by modifying the Windows Registry. Enabling this setting prevents users from adding, deleting, or modifying files on any connected USB storage device, which helps protect against malware infection and unauthorized data transfer.
Step 1: Open the Registry Editor
- Press the Windows Key + R to open the Run dialog box.
- Type
regeditand press Enter (or click OK). - If prompted by User Account Control (UAC), click Yes to allow access.
Step 2: Navigate to the Storage Device Policies Key
In the left-hand navigation pane, go to the following registry path:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control
Step 3: Create the StorageDevicePolicies Key (If Missing)
- Look for a folder (key) named StorageDevicePolicies under the Control folder.
- If it does not exist:
- Right-click the Control folder.
- Select New > Key.
- Name the new key
StorageDevicePoliciesand press Enter.
Step 4: Create and Configure the WriteProtect Value
- Select the StorageDevicePolicies key in the left pane.
- In the right pane, right-click on an empty space and select New > DWORD (32-bit) Value.
- Name this new value
WriteProtectand press Enter. - Double-click the WriteProtect entry to open its edit window.
- Set the Value data field to
1(Hexadecimal base). - Click OK to save the changes.
Step 5: Apply the Changes
- Close the Registry Editor.
- Unplug any connected USB flash drives and reconnect them, or restart your computer to ensure the changes take effect.
Any USB flash drive connected to the system will now be read-only. To
disable write protection in the future, return to the
WriteProtect key and change its value data from
1 back to 0.