TechBuzzPro

How to Remove Write Protection on a USB Flash Drive

· 5 min read · Windows & PC

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To remove write protection from a USB flash drive, first check the physical write-protect switch on the drive itself (if it has one) and slide it to the unlocked position. If there is no switch, the protection is almost always set in software: clear the read-only attribute with Diskpart, or edit the registry key StorageDevicePolicies. In many cases the drive has simply failed and switched itself to read-only to protect your data, so back up anything important before you start. The steps below cover Windows 10 and 11; menu labels can differ slightly by version and region.

What You'll Need

  • A Windows PC (Windows 10 or 11) with an administrator account.
  • The USB flash drive and its cable or direct USB port.
  • Command Prompt or PowerShell, run as administrator.
  • Optional: a backup of the drive's contents, because some fixes erase data.

Step-by-Step

  1. Check the physical switch. Some USB flash drives and SD-card adapters have a tiny sliding switch on the side. If yours does, slide it away from the "Lock" marking. If there is no switch, move on.
  2. Try a different port and PC. Plug the drive directly into a rear USB port on a desktop (not a hub) and test it on another computer. If it is writable elsewhere, the problem is your PC's settings, not the drive.
  3. Open Diskpart. Press Windows key + R, type diskpart, and press Enter. Approve the administrator prompt. In the Diskpart window, type list disk and press Enter. Identify your USB drive by its size — for example, Disk 1 if it is 16 GB. Be careful: picking the wrong disk can wipe your system drive.
  4. Select the disk and clear read-only. Type select disk 1 (replace 1 with your drive's number) and press Enter. Then type attributes disk clear readonly and press Enter. You should see "Disk attributes cleared successfully." Type exit to close Diskpart.
  5. Test the drive. Open File Explorer, right-click the drive, and try creating a new folder or copying a small file onto it. If it works, you are done.
  6. If it is still read-only, check the registry. Press Windows key + R, type regedit, and press Enter. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies. If the key exists, double-click WriteProtect and set its value to 0. If the key does not exist, skip this step — do not create it unless you are following a vendor's instructions.
  7. Restart the PC. Registry changes take effect after a reboot. Unplug the drive, restart, then plug it back in and test again.
  8. Reformat as a last resort. If the drive is still locked, back up your files first, then open Disk Management (right-click Start > Disk Management), right-click the USB drive, and choose Format. Choose exFAT or FAT32 for cross-platform use. Formatting erases everything on the drive.

Common Mistakes

  • Selecting the wrong disk in Diskpart. Always confirm the disk number by size before running select disk. Choosing your system disk can destroy Windows.
  • Ignoring the physical switch. Many people jump straight to software fixes when a tiny switch on the drive is the real cause.
  • Creating the StorageDevicePolicies key from scratch. If the key is absent, adding it can cause more problems than it solves. Only edit an existing WriteProtect value.
  • Formatting before backing up. Formatting wipes the drive. Copy important files off first, even if the drive seems locked — you can usually still read from it.
  • Assuming the drive is fixable. A drive that suddenly becomes read-only and stays that way after every step is often failing. Write protection is a common end-of-life behavior.

Tips

  • Test the drive on a second computer before changing any settings. If it is writable there, the issue is local to your PC.
  • Use a rear USB port on a desktop rather than a front-panel port or hub, which can cause intermittent write errors.
  • Keep a backup of important files on the drive. Read-only mode still lets you copy files off, so do that first.
  • If you use the drive on both Windows and macOS, format it as exFAT to avoid compatibility issues.
  • Label your drives physically so you can identify them quickly in Diskpart and Disk Management.

Troubleshooting

If Diskpart says the attributes were cleared but the drive is still read-only, the controller may have locked itself. Try the registry step if the key exists, then restart. If the drive is still locked after a reboot, open Disk Management and check whether the volume is marked read-only there; some drives need the volume attribute cleared rather than the disk attribute. If the drive shows as "RAW" or has no valid file system, formatting may be the only option — back up first if possible. When none of these steps work on any computer, the drive's flash memory or controller is likely failing. In that case, copy your data off while you still can and replace the drive. Do not keep important files on a drive that has shown write-protection problems.

Frequently Asked Questions

Why did my USB drive suddenly become write-protected?

Common causes are a physical switch, a Windows setting, a failed write, or the drive's controller switching to read-only to protect data when it detects errors. The last case usually means the drive is nearing failure.

Can I remove write protection without formatting?

Yes. The Diskpart and registry steps do not erase data. Formatting is only needed if the file system is damaged or the drive is RAW.

Does this work on Mac?

Macs do not have the same Diskpart tool. On macOS, open Disk Utility, select the drive, and check whether it is read-only. If the drive is locked by hardware, no software step will unlock it.

Will clearing write protection delete my files?

No. The Diskpart attributes disk clear readonly command and the registry edit do not touch your files. Formatting does erase everything.

Is it safe to edit the registry?

Editing the registry is safe if you change only the existing WriteProtect value to 0. Do not create the key if it is missing, and back up the registry before making changes.

What if the drive is still read-only after all steps?

The drive is likely failing. Copy your files off, then replace it. A drive that stays locked across multiple computers is usually at the end of its life.