Share via

how to remove write protection on a USB device using diskpart command

R Aptor 5 Reputation points
2026-03-11T04:44:13.2+00:00

trying to write to a USB device that is write protection

Windows for home | Windows 11 | Devices and drivers
0 comments No comments

2 answers

Sort by: Most helpful
  1. Quinn.HP 8,695 Reputation points Independent Advisor
    2026-03-11T05:50:55.6666667+00:00

    Hello, I'm Quinn and here to help!

    There's usually two reasons for this: Errors in the file system, or worn out drive. Make sure to backup your files from the USB. To remove the write protection using Diskpart, here's how:

    1. Press Win + S, type Command Prompt > Run as Administrator.
    2. Type diskpart, then press Enter.
    3. Type list disk > identify your USB by size.
    4. Type select disk X (replace X with your USB number).
    5. Type attributes disk clear readonly > should remove write protection.
    6. Type exit to quit DiskPart.

    If it still doesn’t work, you may need to reformat the USB. Reformatting will erase all data on the USB, so make sure you back up important files first.

    1. Insert the USB into your computer.
    2. Open File Explorer > go to This PC.
    3. Right-click the USB drive > select Format…
    4. Choose:
      1. File system: FAT32 (for smaller drives) or exFAT/NTFS (for larger drives)
      2. Allocation unit size: Default
      3. Optionally check Quick Format
    5. Click Start, then OK to confirm.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

  2. AI answer

    2026-03-11T04:44:22.45+00:00

    Diskpart cannot remove hardware or firmware-based write protection on a USB device. If the USB stick or SD card has a physical write-protect switch, set that switch to the unlocked position. If the device’s controller or firmware has locked it read-only (for example, due to wear or an internal fault), Diskpart commands will not be able to clear that protection and the device must be replaced.

    For USB sticks and SD cards that are functioning normally, Windows treats them as removable media and they are typically formatted with FAT or FAT32. To change file system or reformat (which removes all data), use standard formatting tools in Windows rather than relying on Diskpart to clear write protection. If the device is locked by policy (for example, by an administrator denying write access to removable storage), that policy must be changed first; Diskpart cannot override Group Policy restrictions.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

    1 person found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.