Skip to content

Instantly share code, notes, and snippets.

@MuhammadSulaiman001
Last active February 25, 2024 05:42
Show Gist options
  • Save MuhammadSulaiman001/fa41c9e8cfd3e75b437c6e9049de7c97 to your computer and use it in GitHub Desktop.
Save MuhammadSulaiman001/fa41c9e8cfd3e75b437c6e9049de7c97 to your computer and use it in GitHub Desktop.
solving "this disk is write protected"

I once had my USB flash drive back from one of my friends! an error message kept showing up everytime I try to format the USB! I Could not solve the issue through windows GUI, got it done with commandline

Open cmd as admin and run the following commands one by one

diskpart
list disk

take the number of the usb disk as a note, use it in the snippet below as an argument for select disk command,

select disk usb-disk-number-taken-from-previous-output
clean
create partition primary
format fs=ntfs quick
assign
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment