Not sure how to format a pendrive using cmd on Windows 10 and earlier versions? This guide explains two methods that use command prompt to clean USB flash drive. Usually, a USB flash drive needs to format when either it is write-protected, filled with old junk files, virus-infected, or damaged.
How to Format Pendrive using Command Prompt
There are two ways to format pendrive using Command Prompt. Make sure to take proper backup of your valuable data before you execute below command line.
Method I
1) Insert the Pendrive which you want to format, into the system.
2) Now, go to My Computers and check the drive letter where the Pendrive has been inserted. That is the drive you will have to format.
3) Now, press Windows and R keys together and type Command
4) Right-click over it and select “Command Prompt (Admin)” from the pop-up menu and run it as administrator.
5) In the command prompt window type:
format <drive name you want to format>:
6) Hit Enter key
7) After the message “and press ENTER when ready…” appears, hit the Enter key again and wait until the percent completed reaches 100.
8) After the message “Volume label (11 characters, ENTER for none)?” appears, hit the enter key again.
Now, your Pendrive successfully formatted using the command line.
But the question arises that why someone format pendrive using cmd, when someone can clean the drive using right-click over the drive. Well, many times the USB drive damaged or corrupt or infected by the virus, in that case, the user-interface option to format the drive doesn’t work. But this can be done using the command prompt, and that’s why this cmd uses to format the pendrive.
Method II
1) Connect the Pendrive you want to format, to your system. Check its size by going to its Properties.
2) Click on Start button, type cmd
3) Right-click over cmd.exe and choose Run as Administrator
4) In the command prompt window type diskpart. Press Enter to enable the service.
5) Now, type list disk. Press Enter to view all the disks on the system along with their status and size.
6) Select the disk which you want to format by identifying the size of the disk seen in step 1. And then type select disk <number>. Press Enter.
7) Now, type clean and press Enter. This takes some time to finish.
8) Now, type creates partition primary. Press Enter. This creates the partition specified.
9) Type select partition 1
10) Type active to activate the partition created and press Enter.
11) Type format fs=ntfs quick if your Pendrive is more than 32 GB. Type format fs=fat32 quick if your Pendrive is less than 32 GB. This formats the disk’s volume quickly.
12) Now, type assign to assign the drive letter or mount point, as the case may be, for Pendrive.
13) Once done, type exit to close the diskpart utility
14) Type exit again to close the command prompt window.