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

  1. Press the Windows Key + R to open the Run dialog box.
  2. Type regedit and press Enter (or click OK).
  3. 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)

  1. Look for a folder (key) named StorageDevicePolicies under the Control folder.
  2. If it does not exist:
    • Right-click the Control folder.
    • Select New > Key.
    • Name the new key StorageDevicePolicies and press Enter.

Step 4: Create and Configure the WriteProtect Value

  1. Select the StorageDevicePolicies key in the left pane.
  2. In the right pane, right-click on an empty space and select New > DWORD (32-bit) Value.
  3. Name this new value WriteProtect and press Enter.
  4. Double-click the WriteProtect entry to open its edit window.
  5. Set the Value data field to 1 (Hexadecimal base).
  6. Click OK to save the changes.

Step 5: Apply the Changes

  1. Close the Registry Editor.
  2. 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.