Fix Windows 'The disk is write-protected' Error on USB and Drives

beginner๐ŸชŸ Windows2026-03-21| Windows 10, Windows 11 โ€” USB flash drives, SD cards, external HDDs/SSDs

Error Message

The disk is write-protected. Remove the write-protection or use another disk.
#windows#disk#write-protected#usb

TL;DR

Start with these two commands in an elevated Command Prompt โ€” they fix roughly 90% of cases:

diskpart
> list disk
> select disk 1        (replace 1 with your disk number)
> attributes disk clear readonly

Still blocked? Check the physical write-protect switch on your USB or SD card, then try the registry fix below.

Why Windows blocks your drive

"The disk is write-protected. Remove the write-protection or use another disk." fires whenever you copy, format, or write to a removable drive that Windows thinks should be read-only. The block can live at several different layers:

  • A physical write-protect switch on the device (SD cards, some USB adapters)
  • The disk's ReadOnly attribute set via diskpart
  • A Windows registry policy (WriteProtect = 1) under Storage Device Policies
  • BitLocker encryption โ€” drive mounts read-only until you unlock it
  • A full or failing drive (less common, but it happens)

Fix 1 โ€” Check the physical switch (30 seconds)

SD cards and some USB adapters have a tiny slider on the side. Flip it toward the unlocked position. Easy to miss, easy to fix. No switch on your device? Skip straight to Fix 2.

Fix 2 โ€” Clear the ReadOnly attribute with diskpart

Open Command Prompt as Administrator, then run:

diskpart

Inside diskpart, list your disks and match by size to find yours:

list disk

Select the right disk and check its flags before clearing them:

select disk 2
attributes disk
attributes disk clear readonly
exit

Running attributes disk first is worth it โ€” you'll see Read-only: Yes change to Read-only: No after the clear. Good sanity check.

If the protection is on the volume rather than the disk itself:

diskpart
> list volume
> select volume 3
> attributes volume clear readonly

Fix 3 โ€” Registry: StorageDevicePolicies

Windows ships with a policy key that can force write-protection across all removable media โ€” often set by IT departments or security software. Check whether it's active:

reg query HKLM\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies /v WriteProtect

See WriteProtect REG_DWORD 0x1? That's your culprit. Reset it to zero:

reg add HKLM\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies /v WriteProtect /t REG_DWORD /d 0 /f

Prefer a GUI? Open regedit and navigate to:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies

Double-click WriteProtect, set the value to 0, then unplug and replug the drive.

No StorageDevicePolicies key at all? This fix doesn't apply โ€” move on to the next one.

Fix 4 โ€” Format the drive (last resort before giving up)

Nothing's worked yet. Formatting is the next step โ€” and yes, it wipes everything. Back up whatever you can before proceeding.

Use diskpart here rather than Windows Explorer's format dialog, which often fails on write-protected drives:

diskpart
> list disk
> select disk 2
> clean
> create partition primary
> format fs=fat32 quick     (or ntfs for larger drives)
> assign
> exit

Pick fat32 for drives shared between Windows, Mac, and Linux. Use ntfs for Windows-only drives or files larger than 4 GB.

Fix 5 โ€” BitLocker drives

A lock icon on the drive in File Explorer means BitLocker. Windows mounts it read-only until you authenticate. Right-click the drive โ†’ Unlock Drive โ†’ enter your password or recovery key. Write access comes back automatically after that.

Not sure if BitLocker is enabled? Check from PowerShell (run as admin):

manage-bde -status D:

Fix 6 โ€” Check drive health

Drives sometimes go read-only on their own when they start failing โ€” it's a self-protection mechanism built into the firmware. If you've tried everything above and nothing helped, this might be why.

Quick SMART status check:

wmic diskdrive get status

For a full report, CrystalDiskInfo is free and shows per-attribute SMART data. If the health reads Caution or Bad, stop using the drive and back up immediately. It's on its way out.

Verify the fix worked

Three commands, ten seconds:

echo test > D:\write_test.txt
type D:\write_test.txt
del D:\write_test.txt

All three complete without errors? The drive is writable again. You can also right-click โ†’ Properties in File Explorer โ€” the Read-only checkbox should be unchecked.

Quick reference โ€” which fix to try first

  • SD card or USB adapter โ†’ Fix 1 (physical switch)
  • USB stick, no physical switch โ†’ Fix 2 (diskpart attributes)
  • Works on other PCs but not this one โ†’ Fix 3 (registry WriteProtect)
  • Can't format even with diskpart โ†’ Fix 4 (diskpart clean)
  • Drive shows a lock icon โ†’ Fix 5 (BitLocker)
  • Nothing works, older drive โ†’ Fix 6 (SMART health check)

Related Error Notes