sodcalculator

10 Tech How-To

Fix Disk Write Protected Error on Windows 10

Guide 10-34236 · Updated · Step by step

The “disk is write protected” error on Windows 10 stops you from writing, deleting, or formatting a drive, but it’s almost always fixable with a few targeted steps. The fix depends on the cause: a physical lock on a USB/SD card, a read-only attribute set in Diskpart, or a registry policy that blocks writes. Below are the proven methods to remove write protection and get your drive working again.

What Causes the Write Protection Error

Windows 10 flags a disk as write-protected when it cannot modify the storage medium. The three most common causes are:

  • Physical lock: Many SD cards and some USB drives have a small switch on the side. If it’s slid to the “lock” position, the device itself refuses writes regardless of software settings.
  • Read-only attribute: The disk’s file system can be marked read-only, often after a failed write, a virus, or an unclean ejection. This attribute persists until explicitly cleared.
  • Registry policy: Windows can enforce write protection globally through a registry key called WriteProtect. This is rare on personal PCs but common on managed or corporate machines.

Less common causes include failing hardware, outdated or corrupted drivers, and third-party encryption or backup software that locks the volume. Before trying any software fix, rule out the physical switch first—it’s the quickest check and the most overlooked.

How to Check the Physical Lock

If you’re using an SD card, microSD adapter, or a USB stick with a sliding tab, inspect the side edge. The lock position is usually labeled “Lock” or shows a small padlock icon. Slide it away from the lock position, reinsert the drive, and try again.

For microSD cards inside an adapter, the lock is on the adapter, not the card itself. Remove the card, check the adapter’s switch, and reseat everything. If the switch is loose or broken, the card may be permanently write-protected—in that case, try a different adapter before assuming the card is dead.

Method 1: Clear the Read-Only Attribute with Diskpart

Diskpart is a built-in command-line tool that can clear the read-only attribute on a disk or volume. This is the most reliable software fix for a persistent write-protection error.

  1. Press Windows + X and select Windows Terminal (Admin) or Command Prompt (Admin).
  2. Type diskpart and press Enter. If prompted by UAC, click Yes.
  3. Type list disk and press Enter. Note the disk number of your write-protected drive (e.g., Disk 1).
  4. Type select disk 1 (replace 1 with your disk number) and press Enter.
  5. Type attributes disk clear readonly and press Enter. You should see “Disk attributes cleared successfully.”
  6. Type exit to close Diskpart, then test the drive.

If the command returns “Disk attributes cleared successfully” but the error persists, the drive may have a hardware-level write-protect flag. In that case, move to the registry method below.

Method 2: Edit the Registry to Remove Write Protection

Windows has a global policy that can force write protection on all removable drives. This is stored in the registry under StorageDevicePolicies. If the key exists and is set to 1, it overrides everything else.

  1. Press Windows + R, type regedit, and press Enter.
  2. Navigate to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies
  3. If the StorageDevicePolicies key does not exist, right-click on Control, select New → Key, and name it StorageDevicePolicies.
  4. Inside that key, look for a DWORD value named WriteProtect. If it exists, double-click it and set the value data to 0. If it doesn’t exist, right-click in the right pane, select New → DWORD (32-bit) Value, name it WriteProtect, and leave it at 0.
  5. Close the Registry Editor and restart your PC.

Be careful when editing the registry—only change the WriteProtect value. Deleting or modifying other keys can cause system instability. If you’re not comfortable with the registry, the Diskpart method is safer.

Method 3: Format the Drive (If You Can Access It)

If the drive is still readable but you just can’t write to it, formatting will clear the read-only attribute and rebuild the file system. This erases all data, so back up anything important first.

  1. Open File Explorer and right-click the write-protected drive.
  2. Select Format.
  3. Choose a file system (NTFS for Windows-only, exFAT for cross-platform), set the allocation unit size to default, and check Quick Format.
  4. Click Start. If the format succeeds, the write protection is gone.

If the format fails with the same write-protect error, the drive’s controller may have locked itself. In that case, try the manufacturer’s formatting tool (if available) or consider the drive as failed.

Common Problems and Misconceptions

Misconception: “The drive is permanently dead.” Not necessarily. Many write-protected drives are recoverable with the steps above. Only if the controller has a hardware fault is the drive truly unusable.

Problem: Diskpart says “Disk attributes cleared successfully” but the error remains. This usually means the write-protect flag is set at the hardware level (common on some USB controllers) or the registry policy is still active. Check the registry method next.

Problem: The error appears on an internal hard drive. Internal drives rarely have a physical lock, so the cause is usually a corrupted file system, a failing drive, or a SATA controller issue. Run chkdsk /f on the drive from an elevated command prompt, and back up data immediately if the drive is making clicking sounds.

Problem: The error appears on a network drive. Network shares can be read-only due to permissions, not write protection. Check the share permissions on the host machine.

Frequently Asked Questions

Q: How do I remove write protection from a USB drive without formatting?
Use Diskpart to clear the attributes, as described above. This preserves all data. If that doesn’t work, the registry method is the next step.

Q: Why does my SD card say write protected even though the lock is off?
If the lock switch is off and the error persists, the card’s controller may have a stuck flag. Try formatting the card in a camera or phone, or use the manufacturer’s recovery tool. If that fails, the card may be damaged.

Q: Can a virus cause write protection?
Yes, some malware sets the read-only attribute on drives to prevent removal. Running a full antivirus scan, then clearing the attribute with Diskpart, usually resolves it.

Q: Does write protection mean my drive is failing?
Not always. It’s often a logical flag that can be cleared. However, if the drive also shows bad sectors, makes unusual noises, or fails to mount, it may be failing. Back up data immediately.

Q: Will editing the registry harm my PC?
Editing the registry always carries some risk, but changing only the WriteProtect value to 0 is safe if done correctly. Always back up the registry or create a restore point before making changes.

When to Give Up and Replace the Drive

If you’ve tried the physical lock, Diskpart, registry, and formatting, and the error still appears, the drive is likely experiencing a hardware failure. This is especially true for older USB drives and SD cards that have been heavily used. At this point, the drive is not reliable for storage, and continuing to use it risks data loss. Replace it with a new one, and consider using cloud storage or a second backup drive for important files.

For internal drives, a persistent write-protect error can indicate a failing controller or damaged sectors. Run a SMART diagnostic if available, and replace the drive if the test flags errors.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →