Quick fix: Open Terminal (Admin), run diskpart → list disk → select disk <N> → attributes disk clear readonly → exit. Removes the read-only attribute from a USB drive that’s falsely marked write-protected.
You try to copy a file to a USB drive and Windows says: The disk is write-protected. Remove the write-protection or use another disk. Some USBs have a physical write-protect switch — but most don’t, and the message appears anyway. Windows sets a software write-protect flag on the disk that survives reboots and even drive removals. The fix is to clear that flag with diskpart or registry.
Affects: Windows 11 (and Windows 10) with USB flash drives or SD cards.
Fix time: ~5 minutes.
What causes this
Write protection comes from one of four sources. Physical write-protect switch: full-size SD cards and some older USB drives have a small slider — flip it. Diskpart readonly attribute: Windows stores a per-disk read-only flag. Once set (sometimes by accident or by a backup tool), it persists. Registry policy: WriteProtect under StorageDevicePolicies. Group Policy can set this to block all USB writes. Drive controller failure: the drive itself has detected internal errors and entered read-only mode to prevent further data loss — this is a hardware-level signal that the drive is dying.
Method 1: Clear the read-only attribute with diskpart
The most common single fix.
- Plug in the USB drive.
- Open Terminal (Admin) from the Start right-click menu.
- Run diskpart:
diskpart - List drives:
list diskThe output shows all drives by number with their size. Identify your USB by size (e.g., a 32 GB USB shows as ~29 GB or ~30 GB).
- Select the USB drive (replace N with the disk number):
select disk NBe very careful with this step — selecting the wrong disk could affect a different drive.
- Check current attributes:
attributes diskLook for Read-only: Yes.
- Clear read-only:
attributes disk clear readonly - Verify the change:
attributes diskShould now show Read-only: No.
- Exit:
exit - Try writing to the drive. The error should be gone.
This catches 70% of write-protection cases. If the drive is still write-protected after this, proceed to Method 2.
Method 2: Remove write protection via registry
Use when diskpart succeeded but write protection persists — the registry policy is overriding diskpart.
- Press
Win + R, typeregedit, press Enter. - Navigate to
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies. - If the StorageDevicePolicies key doesn’t exist, that’s OK — write protection isn’t enforced from here. Continue to Method 3.
- If it does exist, find the WriteProtect DWORD value.
- Set it to 0 (disabled).
- Close Registry Editor.
- Reboot.
- Plug in the USB and try writing. The error should be gone.
This addresses the Group Policy-set write protection that’s common on corporate-managed PCs (where IT may block USB writes).
Method 3: Format the drive (last resort, destroys data)
When the drive accepts writes after Method 1 but the filesystem is also broken — a corrupted filesystem can also produce write-protection symptoms.
- Important: this destroys all data on the drive. Make a copy first if you have anything important on it.
- Open Terminal (Admin).
- Use diskpart to clean and reformat:
diskpart list disk select disk N clean create partition primary format fs=exfat quick label="USB" assign exitReplace N with your USB disk number.
- For drives larger than 32 GB, use
fs=exfat. For smaller drives where you need broad compatibility, usefs=fat32(Windows’ format command supports FAT32 up to 32 GB). - The drive is now freshly formatted and writable.
This is the right move when the drive’s filesystem itself is the issue — the read-only flag may have been a symptom rather than the cause.
How to verify the fix worked
- Open File Explorer. Right-click the USB drive → Properties → General tab. Confirm the size is correct and the filesystem is shown.
- Copy a test file to the drive. The copy completes without errors.
- Run
fsutil behavior query SymlinkEvaluationin Terminal — confirms the filesystem layer is healthy. - The drive remains writable across removal and reinsertion.
If none of these work
If the drive remains write-protected after diskpart, registry, and reformat attempts, the drive itself is failing. Hardware indicator: USB drives include a wear-leveling controller that enters “permanent read-only mode” when its internal flash is exhausted. There’s no software fix for this — your data is still readable, but no more writes will work. Copy the data off (this still works) and replace the drive. Counterfeit or corrupt drive: cheap USB drives from unreliable sources sometimes report fake capacity. The drive accepts writes that go to nowhere or fail silently. Use a free tool like H2testw to verify your USB’s actual capacity matches what it claims. If the drive is counterfeit, the write protection is the manufacturer’s defensive flag — return for refund if possible. SD card lock pin: full-size SD cards have a physical switch; check that yours is up (unlocked). Micro SD cards in SD adapters: the adapter has the switch — the card itself doesn’t. Re-seat the card in the adapter.
Bottom line: Write-protected USB is usually a clearable flag — diskpart attributes disk clear readonly takes care of most cases. Persistent write protection after the fix means the drive is failing.