'The Media Is Write Protected' in Windows 10: How to Actually Remove It

Had a USB drive that Windows refused to write to, throwing “the media is write protected” every time I tried to copy a file or format it. The drive itself had no physical write-protect switch – at least not that I could see. Here’s the full breakdown of what can cause this and how to fix each case.

Case 1: Physical write-protect switch

Some SD cards and USB drives have a small physical lock switch on the side. If this is engaged, it’s hardware-level write protection and no software fix will help. Check for a small slider on the side of the card or drive and move it to the unlocked position.

Case 2: diskpart clearreadonly

This is the most effective software fix:

  1. Open Command Prompt as administrator
  2. Type diskpart and press Enter
  3. Type list disk to see your drives
  4. Type select disk # (replace # with the disk number of your drive)
  5. Type attributes disk clear readonly
  6. Type exit

This removes the read-only attribute at the disk level. Eject and reinsert the drive after running this.

Case 3: Registry edit

Sometimes the write-protect flag is set in the Windows Registry:

  1. Run regedit as administrator
  2. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies
  3. Double-click WriteProtect
  4. Change the value from 1 to 0
  5. Click OK and restart

If StorageDevicePolicies doesn’t exist, write protection is not being set this way and you can skip this step.

Case 4: Corrupted file system or bad sectors

If the above don’t work, the drive may have a corrupted filesystem that Windows is treating as read-only as a protective measure. Try:

  1. Right-click the drive in File Explorer > Properties > Tools > Check
  2. Or run chkdsk X: /f /r in admin Command Prompt (replace X with the drive letter)

chkdsk can fix logical errors. If it finds bad sectors, that points toward hardware failure.

Case 5: The drive is actually failing

If nothing above works and the drive is reporting write protection that can’t be cleared, the most likely explanation is hardware failure. Flash memory has a limited write cycle life, and some drives set themselves to read-only mode to preserve data when they detect impending failure. This is a feature, not a bug – it’s protecting your data. Back up everything on the drive immediately and replace it.

the “drive setting itself to read-only before failing” thing is something i didn’t know. makes sense as a design decision but it’s kind of alarming to find out that way. if none of the software fixes work that’s basically a sign to back up everything immediately.

the diskpart method worked for me on a drive that i thought was completely dead. took about two minutes and fixed it instantly. good that there’s a software path before assuming the hardware is gone.

The registry path is worth knowing but I’d always try diskpart first – it’s faster and doesn’t involve editing the registry. StorageDevicePolicies being set to WriteProtect = 1 is fairly unusual and usually happens after some enterprise policy or group policy modification, not spontaneously.

chkdsk is consistently underused. People reach for third-party disk tools when Windows has a decent built-in option. For logical filesystem errors it’s genuinely effective. The /r flag for bad sector scan takes a while on large drives but is worth running before assuming the drive is physically dead.

The physical write protect switch gets overlooked more than you’d think. I’ve seen someone spend an hour on diskpart and registry edits only to find the tiny lock slider on their SD card adapter. Worth making it the explicit first step in any write protection troubleshooting.