TechBuzzPro

How to Format a Write-Protected USB in Windows 10

· 6 min read · Windows & PC

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To format a write-protected USB drive in Windows 10, first remove the write protection using Diskpart's attributes disk clear readonly command, then format the drive normally. If that fails, check the physical write-protect switch (on SD cards and some USB drives), the registry StorageDevicePolicies key, and the drive's health—a failing drive may be permanently locked. This guide walks through each method in order, from safest to most invasive, and explains what to do when Windows still refuses to format.

What You'll Need

  • A Windows 10 PC with an administrator account (you'll need to approve UAC prompts).
  • The write-protected USB drive and a free USB port.
  • Command Prompt or PowerShell—both are built in; no extra software required.
  • Optional: a backup of any data on the drive, because formatting erases everything.

Step-by-Step

  1. Back up your data. Formatting destroys all files on the USB drive. If you can still read the drive, copy anything important to your PC first. If the drive is completely inaccessible, skip this step and accept that the data may be lost.
  2. Check for a physical write-protect switch. Some USB flash drives and most SD cards have a tiny sliding tab on the side. If present, slide it away from the “Lock” position. If your drive has no switch, move on.
  3. Open Diskpart as administrator. Press Windows + R, type diskpart, and press Ctrl + Shift + Enter (or right-click Command Prompt and choose “Run as administrator,” then type diskpart). Approve the UAC prompt.
  4. List and select the disk. In Diskpart, type list disk and press Enter. Identify your USB drive by its size (e.g., 14 GB or 28 GB). Type select disk N (replace N with the correct number) and press Enter. Double-check the number—selecting the wrong disk can wipe your system drive.
  5. Clear the read-only attribute. Type attributes disk clear readonly and press Enter. You should see “Disk attributes cleared successfully.” Then type exit to close Diskpart.
  6. Format the drive in File Explorer. Open File Explorer, right-click the USB drive, and choose “Format.” Select a file system (FAT32 for drives up to 32 GB, exFAT or NTFS for larger ones), leave “Quick Format” checked, and click Start. If the Format option is greyed out or you get an error, continue to the next step.
  7. Use Disk Management as an alternative. Right-click the Start button and choose “Disk Management.” Find your USB drive, right-click its partition, and choose “Format.” Follow the wizard. If the partition is marked “Read-only,” right-click the disk label (left side) and choose “Properties” > “Volumes” to confirm the status.
  8. Check the registry policy (advanced). If Diskpart didn't help, a registry key may be enforcing write protection. Press Windows + R, type regedit, and press Enter. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies. If the key exists, double-click WriteProtect and set its value to 0. If the key doesn't exist, skip this step—do not create it unless you have a specific reason. Restart your PC and try formatting again.
  9. Try a different port and PC. Sometimes a faulty USB port or hub causes write errors that look like write protection. Plug the drive directly into a rear USB port on a desktop, or try another computer. If it formats elsewhere, the issue is with your PC's port or drivers.
  10. Use the official manufacturer tool as a last resort. Some brands (SanDisk, Kingston, Samsung) offer official formatting utilities. Download only from the manufacturer's own support site. These tools can sometimes revive a drive that Windows cannot format, but they still cannot fix physically failing hardware.

Common Mistakes

  • Selecting the wrong disk in Diskpart. Always verify the disk number by size and label before running clean or format. Selecting your system disk will destroy Windows.
  • Ignoring the physical switch. Many “write-protected” USB drives are simply locked by a sliding tab. Check before running any software fix.
  • Using the wrong file system. FAT32 has a 4 GB file size limit; exFAT is better for large files and works across Windows and macOS. NTFS is Windows-only for writing on some devices.
  • Editing the registry without a backup. Before changing WriteProtect, export the key (right-click > Export) so you can restore it if something goes wrong.
  • Assuming the drive is fixable. If the drive shows 0 bytes, disappears from Disk Management, or clicks, it has likely failed. No software can repair failing flash memory.

Tips

  • Run Diskpart and Disk Management as administrator—standard user accounts cannot clear disk attributes.
  • After clearing the read-only attribute, unplug and replug the drive before formatting; Windows sometimes caches the old state.
  • If you only need to copy files off the drive, try a Linux live USB—Linux often ignores Windows write-protect flags. This is a read-only workaround, not a repair.
  • Keep your USB drive formatted as exFAT if you use it on both Windows and Mac; it avoids the 4 GB limit of FAT32 and is widely supported.
  • Regularly back up important USB drives—flash memory can fail without warning, and write protection is sometimes the first sign.

Troubleshooting

If the drive still won't format after clearing the read-only attribute, work through these checks in order:

  • Diskpart shows “The disk is write protected” again. Re-run attributes disk clear readonly. If it fails immediately, the drive's controller has locked itself—often a sign of wear or corruption. Try the manufacturer's tool.
  • Format fails with “Windows was unable to complete the format.” Open Disk Management, delete the existing partition (right-click > Delete Volume), then create a new simple volume and format it. This erases all data but can revive a corrupted partition table.
  • The drive appears as “RAW” in Disk Management. A RAW drive has no readable file system. Use Diskpart: select disk N, clean, create partition primary, format fs=exfat quick. This destroys all data.
  • Registry key doesn't exist and Diskpart fails. Check Group Policy: press Windows + R, type gpedit.msc (Pro editions only), and navigate to Computer Configuration > Administrative Templates > System > Removable Storage Access. Ensure “Removable Disks: Deny write access” is not enabled. On Home editions, this policy is not available; use the registry method instead.
  • Drive is not detected at all. Try another cable (if external), another port, and another PC. If it still doesn't appear in Disk Management, the drive is likely dead. Data recovery services are the only option for the files.

Frequently Asked Questions

Why is my USB drive write-protected?

Common causes include a physical lock switch, a corrupted file system, a registry or Group Policy setting, or the drive's controller entering a protective read-only state due to wear or errors. Less often, malware or a failing USB port is responsible.

Can I format a write-protected USB without losing data?

No. Formatting erases everything. If you need the data, copy it off first using a method that bypasses write protection (like a Linux live environment) before formatting.

Does Diskpart work on all USB drives?

Diskpart can clear the read-only attribute on most drives, but it cannot override a physical switch or repair hardware failure. If the drive's controller is locked, Diskpart will report an error.

Is it safe to edit the registry to remove write protection?

Yes, if you export a backup of the key first and only change the WriteProtect value. Do not delete the entire StorageDevicePolicies key unless you created it yourself.

What if the USB drive is physically damaged?

No software can fix a physically failing drive. If the drive clicks, is not detected, or shows 0 bytes, replace it. For important data, consult a professional data recovery service.

Can I use a third-party format tool?

Only download tools from the drive manufacturer's official website. Avoid unknown “USB format” utilities—they can contain malware or cause further damage.