sodcalculator

10 Tech How-To

Fix Error 0x80070013: Causes & Solutions

Guide 10-52911 · Updated · Step by step

Error 0x80070013 is a Windows Update and file-copy error that means “The media is write protected,” so the fix is to remove write protection from the drive or folder you’re using, then retry the update or file operation. This error commonly appears when installing Windows updates, copying files to a USB drive or SD card, or when Windows Update tries to write to a protected system partition. Below, we explain what causes the error, how to resolve it step by step, and answer common questions.

What Does Error 0x80070013 Mean?

Windows error codes are hexadecimal numbers that map to specific system messages. The code 0x80070013 translates to ERROR_WRITE_PROTECT, which Windows defines as “The media is write protected.” In plain terms, the operating system attempted to write data to a storage device or location that is currently set to read-only. This can happen with:

  • USB flash drives and external hard drives with a physical write-protect switch.
  • SD cards and microSD cards with a lock slider on the side.
  • Files or folders marked as read-only in their properties.
  • System partitions or volumes where the disk is set to read-only in DiskPart.
  • Network drives or shared folders where you lack write permissions.

While the error text is straightforward, the underlying cause can be one of several things, so the fix depends on where the write is being attempted.

Common Scenarios and Their Causes

The error appears in different contexts, and the root cause varies:

  • Windows Update: When updating Windows, the system needs to write to the system partition (usually C:). If that partition is marked read-only, or if a third-party tool like a disk cleaner has set it to read-only, the update fails with 0x80070013.
  • Copying files to USB/SD: If you plug in a USB drive or SD card that has a physical lock switch, and it’s in the locked position, any write attempt fails. Even without a switch, the drive may have been set to read-only via software.
  • File or folder properties: A file or folder with the “Read-only” attribute checked will cause write errors when you try to modify or save to it.
  • DiskPart read-only attribute: A disk volume can be set to read-only using DiskPart, and it will remain that way until you clear the attribute.
  • Permissions: On network shares or external drives, the current user may not have write permission, which Windows also reports as write-protected.

How to Fix Error 0x80070013

Follow these steps in order, as they move from the most common to the more advanced fixes. Stop when the error is resolved.

  1. Check for a physical write-protect switch. Look at the USB drive or SD card. If there’s a small slider, move it to the unlocked position (usually away from the “lock” icon). Reinsert the device and try again.
  2. Check file/folder properties. Right-click the file or folder you’re trying to write to, select Properties, and under the General tab, uncheck Read-only. Click Apply and choose “Apply changes to this folder, subfolders and files” if prompted.
  3. Clear the read-only attribute on the disk. Open Command Prompt as Administrator (search “cmd”, right-click, Run as administrator). Type diskpart and press Enter. Then type list volume to see all volumes. Identify the volume that is causing the issue (e.g., the USB drive or the system volume). Type select volume X (replace X with the volume number). Then type attributes volume clear readonly and press Enter. Exit DiskPart with exit.
  4. Run Windows Update Troubleshooter. If the error occurs during Windows Update, go to Settings > Update & Security > Troubleshoot > Additional troubleshooters, select Windows Update, and run the troubleshooter. It can automatically fix common update issues.
  5. Check disk permissions. Right-click the drive or folder, select Properties, go to the Security tab, and ensure your user account has Full control or at least Write permission. If not, click Edit and grant the permission.
  6. Scan for disk errors. Open Command Prompt as Administrator and run chkdsk /f X: (replace X with the drive letter). This will check and repair file system errors that might cause write protection. You may need to restart if it’s the system drive.

What to Do If the Fix Doesn’t Work

If you’ve tried the above and still get the error, consider these additional steps:

  • Try a different USB port or computer. Sometimes the drive’s controller or the port can cause issues.
  • Use a different USB drive. If the drive is physically failing, it may become read-only to protect data. Test with another drive.
  • Check for third-party disk encryption or write-protection software. Some security tools can lock drives. Temporarily disable them to test.
  • Boot into Safe Mode. If the error occurs during Windows Update, boot into Safe Mode and try the update again. Safe Mode loads minimal drivers and may bypass the issue.
  • Reset Windows Update components. If the error persists during updates, you can reset the Windows Update components manually. This involves stopping the Windows Update service, clearing the SoftwareDistribution folder, and restarting the service. Detailed steps are available from Microsoft’s official support pages.

Preventing the Error in the Future

To avoid encountering 0x80070013 again, adopt these habits:

  • Always eject USB drives safely before removing them.
  • Keep physical write-protect switches in the unlocked position when you need to write.
  • Regularly run chkdsk on external drives to catch errors early.
  • Ensure your user account has proper permissions on all drives you use.
  • Keep Windows updated, as update fixes often address such errors.

Frequently Asked Questions

Can error 0x80070013 damage my files?

No, the error itself doesn’t damage files. It prevents writes, so your existing data remains intact. However, if the drive is failing, the read-only state is a protective measure, and you should back up data immediately.

Why does my USB drive suddenly become read-only?

Common reasons include a physical lock switch being toggled, the drive’s file system errors, or the drive being set to read-only by DiskPart or third-party software. It can also be a sign of impending hardware failure.

Does this error occur on Mac or Linux?

The specific code 0x80070013 is Windows-specific. However, write-protection errors occur on all operating systems. On Mac, you might see “The disk is locked,” and on Linux, “Read-only file system.” The fixes are similar: check physical switches, permissions, and mount options.

How do I know if my drive has a physical write-protect switch?

Look at the side of the USB drive or SD card adapter. There is often a small slider that can be moved up or down. If it’s in the locked position (usually with a small lock icon), you won’t be able to write. Move it to the unlocked position and reinsert the device.

Is it safe to use DiskPart to clear the read-only attribute?

Yes, using attributes volume clear readonly is safe for the volume you select, as long as you select the correct volume. It only clears the read-only flag; it doesn’t delete data. However, be careful not to select the wrong volume, as clearing read-only on a system volume could cause issues if it was set for a reason.

Can a virus cause error 0x80070013?

Yes, some malware can set drives to read-only as a defense mechanism or to prevent removal. If you suspect malware, run a full system scan with Windows Defender or a reputable antivirus tool before attempting fixes.

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 →