Advertisement

How to Turn Write Protection On or Off for a USB Flash Drive

Zeynel -
9 days ago

This guide was AI-assisted, human-reviewed, and enhanced with real screenshots to ensure accuracy and ease of use.

Write protection is a useful feature that prevents files on your USB flash drive from being accidentally deleted or modified. But beyond accidental edits, one major reason to enable write protection is to protect your drive from malware or viruses — especially when plugging it into public or unfamiliar computers. While not foolproof, write protection can block many types of malicious software from writing themselves onto your drive, making it a simple yet effective layer of defense.

 

On the flip side, it can be frustrating when you need to copy new files or make changes and can't figure out how to disable it. Whether you're trying to lock down your USB for safety or unlock it for updates, here's how you can turn write protection on or off.

What is Write Protection?

Write protection prevents any changes from being made to the contents of your USB flash drive. When enabled, you can’t add, delete, or format files. It’s useful for preserving important data, but disabling it might be necessary for updates or transferring new files.

How to Turn OFF Write Protection

This is the simplest method, but not all drives have this feature.

If you're receiving an error like "The disk is write-protected", try the following methods:

1. Check the Physical Lock Switch

Some USB drives have a small switch on the side labeled “Lock” or “Write Protect.”

  • Slide the switch to the off or unlocked position.
  • Reinsert the USB drive and try again.

2. Use Diskpart Command (Windows)

  1. Press Win + R, type cmd, and press Enter to open Command Prompt.
  2. Type diskpart and hit Enter.
  3. Type list disk and hit Enter.
  4. Identify your USB drive (usually by size).
  5. Type select disk # (replace # with your USB’s number).
  6. Type attributes disk clear readonly and hit Enter.
     
  7. Type exit.

This method changes the drive's own attributes, so it affects the USB itself. The change will persist across computers.

3. Edit the Registry (Windows)

This method is limited to the current computer. If you use the USB drive on another machine, the write protection may still be active there depending on the method used.

Note: Be careful when editing the registry. Making incorrect changes can harm your system.

  1. Press Win + R, type regedit, and press Enter.
  2. Navigate to:
  1. Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies
  1. If WriteProtect exists, double-click it and change its value to 0.
  2. If not, create it:
    • Right-click → New → DWORD (32-bit) Value → name it WriteProtect
    • Set its value to 0
  3. Restart your computer.

4. Format the Drive (Last Resort)

If nothing works and you’re okay with erasing all data:

  1. Insert your USB drive.
  2. Open This PC, right-click the USB drive, and choose Format.
  3. Choose file system (e.g., FAT32 or NTFS), uncheck Quick Format (optional), and click Start.

This will permanently delete everything on the drive.

How to Turn ON Write Protection

Want to prevent others from modifying your files? Here are a few ways to enable write protection:

1. Use the Physical Switch

  • Flip the lock switch to the on position.

2. Use Diskpart Command

Follow the same steps as above, but use:

attributes disk set readonly
 

This sets the protection on the USB drive itself, and the setting will remain even when used on another computer.

3. Use Registry Editor

Set the WriteProtect value to 1 in the registry path:

Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies

If the StorageDevicePolicies folder doesn't exist in the Registry, you can create it manually. WriteProtect is a value of type REG_DWORD.

This change only applies to the computer where you set it. It won’t affect the USB drive on other systems.

Conclusion

Write protection can be your best friend or your worst enemy depending on the situation. With the methods above, you can toggle it on or off depending on your needs.

  • Use Diskpart or the physical switch if you want the setting to persist across different computers.
  • Use the Registry if you only want to control write protection on a specific computer.

 

Did you find this article useful?
0 0
Share this page on:

Latest articles

Keyboard shortcuts

Advertisement



Only registered users can post links.
 
No comments yet. Ask, or type the first one!