To remove write protection from a USB drive or SD card, first check for a physical lock switch and slide it to the unlocked position. If there is no switch, or that does not help, open diskpart as administrator and run attributes disk clear readonly on the drive. If it is still protected, check the WriteProtect registry value and the Group Policy settings that can block writes to removable drives. If none of these work, the drive's controller has probably locked itself to read-only because the memory is failing. In that case, copy your files off and replace it, because no software can reverse it.
Below are the steps in order, from quickest to most involved. They work on Windows 10 and Windows 11.
Why a drive becomes write-protected
| Cause | How common | Fixable? |
|---|---|---|
| Lock switch on the SD card, adapter or USB drive | Very common | Yes, slide the switch |
| Read-only attribute set on the disk or volume | Common | Yes, with diskpart |
| Registry WriteProtect value | Occasional | Yes, with Registry Editor |
| Group Policy or company security settings | Common on work PCs | Yes, if you are allowed to change them |
| Controller locked due to worn-out memory | Common on old or cheap drives | No |
Step 1: Check the lock switch
Full-size SD cards and microSD-to-SD adapters have a small slider on the left edge. Slide it up, toward the contacts, to unlock. Some USB flash drives and portable SSDs also have a lock switch on the side. If you use a microSD card in an adapter, the switch is on the adapter, so try a different adapter as well. A loose switch can slip into the locked position as the card is inserted.
Step 2: Make sure it is really write protection
Two other problems are often mistaken for write protection:
- "The file is too large for the destination file system." The drive is formatted FAT32, which cannot store single files of 4 GB or more. It is not write-protected. Reformat it as exFAT or NTFS after backing it up.
- A read-only file or folder. If only some files cannot be changed, right-click them, choose Properties, and untick Read-only.
True write protection produces the message "The disk is write-protected. Remove the write-protection or use another disk."
Step 3: Clear the read-only attribute with diskpart
- Right-click Start and choose Terminal (Admin). Type
diskpartand press Enter. - Type
list disk. Find your USB drive or card by its size. - Type
select disk 2, replacing 2 with your drive's number. Double-check the number: choosing the wrong disk here is how mistakes happen. - Type
attributes disk. If Current Read-only State says Yes, continue. - Type
attributes disk clear readonly. You should see "Disk attributes cleared successfully." - Type
list volume, thenselect volume 6(your drive's volume number), andattributes volume clear readonlyto clear the flag at volume level too. - Type
exit, unplug the drive, and plug it back in.
If diskpart reports an error or the flag comes straight back, the protection is coming from the drive itself, a policy, or the hardware.
Step 4: Check the registry
A registry value can make Windows treat all USB storage as read-only.
- Press Win + R, type
regeditand press Enter. - Go to
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies. - If the key exists and contains a value named WriteProtect, double-click it and set it to 0.
- Close Registry Editor and restart the PC.
If the StorageDevicePolicies key does not exist, this is not your problem. There is no need to create it.
Be careful in Registry Editor: change only the value described here. If the value keeps returning to 1 after a restart, something on the PC is setting it, such as security software with USB control features or a management policy. Check those settings, or ask whoever manages the PC.
Step 5: Check Group Policy
On Windows Pro, Enterprise and Education, policies can block writes to removable drives. Press Win + R, type gpedit.msc, and check:
- Computer Configuration → Administrative Templates → System → Removable Storage Access: look at Removable Disks: Deny write access and All Removable Storage classes: Deny all access.
- Computer Configuration → Administrative Templates → Windows Components → BitLocker Drive Encryption → Removable Data Drives: look at Deny write access to removable drives not protected by BitLocker.
Set any that are Enabled to Not Configured, then restart. Check the same settings under User Configuration as well.
On a work or school PC, these policies are usually set on purpose by your IT team to protect company data. Ask them rather than changing them yourself.
Step 6: When the drive has locked itself
Flash memory wears out. When a USB drive or SD card's controller detects that its memory can no longer be written safely, many switch to permanent read-only mode. This is a protective feature: it stops you saving new files that would be lost, while letting you copy existing files off.
Signs that this is what has happened: diskpart cannot clear the flag, formatting fails with "The disk is write-protected", and the drive behaves the same on every computer. There is no reliable software fix. Copy everything off while you can and replace the drive.
Disk Detector checks whether a removable drive is write-protected and helps you see why: a setting you can change, or a drive that is failing. It also tests whether a USB stick or SD card really has the capacity it claims, since cheap fake drives often fail in confusing ways. Learn more in our guide on how to check if a USB flash drive is fake.
After removing write protection
Once you can write to the drive again, test it by copying a file to it and opening it. If the drive was write-protected for no obvious reason, check its health before trusting it with important files. Disk Detector reports removable drive problems in plain English, so you can decide whether to keep using it. If Windows does not recognize the drive at all, see our guide to a USB flash drive not recognized, and for card readers, an SD card not showing up.
Frequently asked questions
Why does my USB say the disk is write-protected?
It may have a lock switch, a read-only attribute, a Windows policy blocking writes to removable drives, or a failing controller that locked itself.
Can a failing USB drive become write-protected on its own?
Yes. Many flash drives switch to permanent read-only mode when the controller detects worn-out memory. Copy your files off and replace it.
Does formatting remove write protection?
No. Windows cannot format a write-protected drive, so you must remove the protection first.
