sodcalculator

10 Tech How-To

Remove Write Protection from USB Flash Drive in Windows

Guide 10-60011 · Updated · Step by step

If you’re seeing “The disk is write-protected” when trying to copy files to your USB flash drive, the drive is set to read-only mode. This guide shows you how to remove write protection in Windows using built-in tools, covering both software and hardware causes. You’ll need a Windows PC and the affected USB drive.

What You’ll Need

  • A Windows PC (Windows 10 or 11 recommended)
  • The write-protected USB flash drive
  • Admin access to the PC (to run Command Prompt as administrator)

Step-by-Step

  1. Check for a physical lock switch. Many USB drives have a small sliding tab on the side. If it’s set to “Lock,” slide it to the unlocked position. Reinsert the drive and try again.
  2. Run DiskPart to clear the read-only attribute. Press Windows + R, type diskpart, and press Enter. If prompted by User Account Control, click “Yes.”
  3. List your disks. In the DiskPart window, type list disk and press Enter. Note the disk number of your USB drive (e.g., Disk 1). Be careful: selecting the wrong disk will affect the wrong drive.
  4. Select your USB drive. Type select disk X (replace X with your disk number) and press Enter. You should see “Disk X is now the selected disk.”
  5. Clear the read-only attribute. Type attributes disk clear readonly and press Enter. If successful, you’ll see “Disk attributes cleared successfully.”
  6. Exit DiskPart. Type exit and press Enter. Safely eject your USB drive, then reinsert it and test if you can write files.
  7. If DiskPart fails, try a registry fix. Press Windows + R, type regedit, and press Enter. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies. If the key doesn’t exist, right-click on Control, select New > Key, and name it StorageDevicePolicies.
  8. Set the WriteProtect value. In the right pane, look for a DWORD named WriteProtect. If it exists, double-click it and set its value to 0. If it doesn’t exist, right-click in the pane, select New > DWORD (32-bit) Value, name it WriteProtect, and set its value to 0.
  9. Restart your PC. Close the Registry Editor and restart your computer. After restart, plug in the USB drive and test writing.
  10. Format the drive as a last resort. If the drive still shows write-protected, the drive may be corrupted or failing. Formatting will erase all data. Open File Explorer, right-click the drive, select “Format,” choose a file system (FAT32 for compatibility, NTFS for large files), and click “Start.” Note: formatting may not work if the drive is physically locked or failing.

Common Mistakes

  • Selecting the wrong disk in DiskPart. This can erase your internal hard drive. Always double-check the disk number and size.
  • Not running DiskPart as administrator. DiskPart requires admin privileges; otherwise, you’ll get an access denied error.
  • Ignoring the physical lock. Some drives have a tiny switch that’s easy to miss. Always check it first.
  • Using the wrong registry path. The StorageDevicePolicies key must be under Control, not directly under CurrentControlSet.
  • Formatting without backing up data. Formatting erases everything, so always try other methods first.

Tips

  • If the drive is brand new and write-protected, it might be a defective unit. Try it on another computer to confirm.
  • Use DiskPart’s detail disk command after selecting the disk to see if the “Current Read-only State” is “Yes” or “No.” This helps verify the issue.
  • If you need to keep data, try copying files off the drive before attempting fixes that might fail.
  • For drives that are still under warranty, contact the manufacturer before trying risky fixes like formatting.

Troubleshooting

If the write protection persists after following all steps:

  • Check if the drive is physically damaged. A damaged controller chip can force read-only mode. Listen for clicking sounds or check if the drive gets unusually hot.
  • Try a different USB port. Sometimes a faulty port can cause issues. Use a rear port on a desktop or a different hub.
  • Use a third-party formatting tool. Some tools like HP USB Disk Storage Format Tool can force-format drives that Windows refuses. However, use them at your own risk and only after backing up data.
  • Check Disk Management. Press Windows + X and select “Disk Management.” Look at your USB drive’s partition. If it shows as “Healthy (Active, Primary Partition)” but still write-protected, the issue is likely firmware or hardware.
  • If the drive is still under warranty, replace it. Persistent write protection often indicates a failing drive.

Frequently Asked Questions

Why is my USB drive suddenly write-protected?

Common causes include a physical lock switch, a corrupted file system, a failing drive, or a registry setting that blocks writes. It can also happen if the drive was used on a device that set a read-only flag.

Can I remove write protection without formatting?

Yes, the DiskPart and registry methods above do not format the drive, so your data is preserved. Only try formatting as a last resort.

Why does DiskPart say “Disk attributes cleared successfully” but I still can’t write?

This can happen if the drive has a hardware lock or if the file system is corrupted. Try formatting the drive, or check if the physical switch is still on.

Is it safe to edit the registry to fix write protection?

Editing the registry is safe if you follow the steps exactly and only change the WriteProtect value. Always back up the registry before making changes, and never delete other keys.

Can I use a Mac or Linux to remove write protection?

You can try using diskutil on Mac or hdparm on Linux, but the steps differ. The Windows methods here are specific to Windows.

What if my USB drive is still under warranty?

Contact the manufacturer. If the drive is defective, they may replace it. Avoid opening the drive or attempting repairs that could void the warranty.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →