'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.