How to Remove Write Protection from USB on Windows
In this article
To remove write protection from a USB drive on Windows, first check the physical lock switch on the drive itself, then try the registry edit (StorageDevicePolicies) or Diskpart's attributes disk clear readonly command. Most write-protection problems are caused by a tiny lock switch or a corrupted file system, not by Windows itself. This guide walks through each fix in order, from least to most invasive, so you can restore normal read/write access without losing data.
What You'll Need
- Your USB drive and the Windows PC it is plugged into.
- Administrator rights on that PC (needed for Diskpart and Registry Editor).
- A backup of any important files on the drive, if you can still read them.
- Optional: a second USB drive or cloud storage to copy files off before formatting.
Step-by-Step
- Check the physical write-protect switch. Many SD cards and some USB drives have a tiny sliding tab on the side or bottom. If it is set to "Lock," the drive is read-only no matter what Windows settings you change. Slide it to the unlocked position and reinsert the drive.
- Try a different USB port and a different PC. A failing port or a front-panel hub can cause write errors that look like write protection. Plug the drive directly into a rear USB port on the motherboard if possible. If it works on another PC, the problem is with the original PC's settings or drivers.
- Open Diskpart and clear the read-only attribute. Press Windows + R, type
diskpart, and press Enter. Click Yes on the User Account Control prompt. In the Diskpart window, typelist diskand press Enter. Identify your USB drive by its size (be careful not to pick your system disk). Typeselect disk X(replace X with the USB disk number) and press Enter. Then typeattributes disk clear readonlyand press Enter. Typeexitto close Diskpart. Safely eject and reinsert the drive, then try copying a file to it. - Check the registry for a write-protect policy. Press Windows + R, type
regedit, and press Enter. Navigate toHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies. If the key does not exist, skip to the next step. If it exists, look for a value namedWriteProtectin the right pane. Double-click it and set the value to 0. Click OK, close Registry Editor, and restart the PC. Note that menu labels and key paths can differ slightly between Windows versions, so if you don't see the exact key, your edition may not use it. - Run a check disk to repair file system errors. Open File Explorer, right-click the USB drive, and choose Properties. Go to the Tools tab and click Check under Error checking. Follow the prompts to scan and repair the drive. A corrupted file system is a common cause of sudden write protection, and this step can fix it without erasing data.
- Reinstall the USB driver. Right-click the Start button and choose Device Manager. Expand Disk drives, right-click your USB drive, and select Uninstall device. Unplug the drive, restart the PC, then plug the drive back in. Windows will reinstall a fresh driver automatically.
- Format the drive as a last resort. Warning: formatting erases everything on the drive. First copy any files you need to another location. Then open File Explorer, right-click the USB drive, and choose Format. Select FAT32 or exFAT (exFAT is better for drives larger than 32 GB), leave Quick Format checked, and click Start. If Windows refuses to format because the drive is write-protected, use Diskpart:
list disk,select disk X,clean, thencreate partition primary,format fs=exfat quick, andassign. The clean command wipes the entire drive, including the partition table.
Common Mistakes
- Selecting the wrong disk in Diskpart. Always double-check the disk number and size before running any command, because
cleanon your system disk will destroy Windows. - Ignoring the physical lock switch. Many users spend an hour in the registry when the drive's own tab is set to Lock.
- Editing the registry without a backup. Export the key before changing it, or create a System Restore point.
- Formatting before copying files off. If the drive is readable but not writable, copy your data first.
- Using third-party "write protection removal" tools from unknown sites. Stick to Windows built-in tools like Diskpart and Disk Management.
Tips
- Test write access after each fix by creating a small text file on the drive. If it saves, you're done.
- Keep a backup of important USB data on another drive or in the cloud, since write protection often signals the drive is failing.
- If the drive becomes write-protected repeatedly, it may be worn out. USB flash memory has a limited number of write cycles, and some drives lock themselves when they detect failure.
- Use exFAT for drives you move between Windows and Mac, and NTFS if you need Windows-only features like permissions.
Troubleshooting
If Diskpart says "Access is denied" or "The disk is write protected" even after clearing the attribute, the drive's controller may have locked itself permanently. Try the registry fix and a different PC before concluding the drive is dead. If the registry key StorageDevicePolicies is missing, you can create it: right-click Control, choose New > Key, name it StorageDevicePolicies, then create a DWORD value named WriteProtect and set it to 0. If Check Disk fails with errors it cannot repair, back up what you can and replace the drive. If formatting fails in File Explorer, use Disk Management (right-click Start > Disk Management) to delete the volume and create a new one. When none of these steps work, the USB drive is likely in a permanent read-only state caused by hardware failure, and no software fix will restore write access.
Frequently Asked Questions
Why does my USB suddenly become write-protected?
Common causes are a physical lock switch, file system corruption, a registry policy, or the drive's controller detecting wear and locking itself to protect data.
Can I remove write protection without losing data?
Yes, in most cases. The Diskpart attribute clear, registry edit, and Check Disk steps do not erase files. Formatting does erase data, so try the other steps first.
Does the registry fix work on Windows 11?
The StorageDevicePolicies key is not present by default on many Windows 11 systems, but you can create it manually. The Diskpart method is more reliable across versions.
What if Diskpart shows my USB as read-only and won't clear it?
That usually means the drive's firmware has locked it, often due to hardware failure. Try it on another PC; if it stays locked, replace the drive.
Is it safe to use third-party write-protection removal tools?
It's safer to use Windows built-in tools. Third-party utilities from unknown sources can contain malware or cause further damage.
Can a USB drive be permanently write-protected?
Yes. Some drives enter a permanent read-only mode when their flash memory wears out. In that case, the drive can still be read but not written to, and should be replaced.