
How to Format a Write–Protected Pen Drive Using CMD
If your pen drive is write-protected, you may not have the ability to modify files or format your drive due to restrictions associated with permissions and sharing. You can format a write-protected pen drive in Windows using Command Prompt.
Using Diskpart in Command Prompt (Windows)

Insert your write-protected pen drive into an open USB slot on your Windows computer.




2
Click on “Start” and type “cmd.exe” into the search field.
-
3Double-click on Command Prompt to launch the program.
-
4Type “diskpart,” then press Enter on your keyboard.
-
5Type “list disk,” then press Enter.
-
6Type “select disk x” — with x being the number of your pen drive as listed in Command Prompt — then press Enter. If unsure which number is associated with your pen drive, refer to the disk size listed. For example, if your pen drive is 2 GB, select the disk number next to the drive with 2 GB specified as the disk size.
-
7Type “attributes disk clear readonly,” then press Enter.
-
8Type “clean,” then press Enter.
-
9Type “create partition primary,” then press Enter.
-
10Type “format fs=fat32,” then press Enter. Alternately, you can replace “fat32” with “ntfs” if you plan on only using your pen drive with Windows devices.
-
11Type “exit,” then press Enter. Your pen drive will now be formatted, and will no longer be write-protected.