How To Format USB Flash Drive Via Command Prompt In Windows 10


Formatting a USB flash drive is a straight-forward job in Windows operating system. In the File Explorer, right-click on the USB drive, click Format, select a file system for the drive, and then click Format button to format the USB drive.

At times, you might not be able to format a USB drive by following the directions mentioned above. You might get “Windows was unable to complete the format” message.

format USB flash drive via Command Prompt in Windows 10 pic01

If you are getting any error while formatting the drive or if the drive fails to show up in the File Explorer even after assigning a drive letter to it, you can use the Command Prompt to format the USB drive.

Complete the given below directions to format the USB drive via Command Prompt in Windows 10.

IMPORTANT: Formatting the USB drive will erase all data on it. So, if the data is important, please move all the data to a safe location before proceeding further.

Format USB pen drive via Command Prompt in Windows 10

Step 1: Run Command Prompt as administrator. To do so, type CMD in the Start/taskbar search box, right-click on the Command Prompt entry in the search results, and then click Run as administrator option.

Click Yes button when you get the User Account Control screen to continue.

Step 2: In the Command Prompt, execute the following commands one after another.


Press Enter key to run the Diskpart tool.

List Disk

Press Enter key. Now, the DiskPart tool will list all the drives connected to your PC, including your internal drives. Identify the USB drive that you want to format and note down its disk number. For instance, as you can see in the picture, my USB drive’s disk number is 1.

format USB flash drive via Command Prompt in Windows 10 pic2

If you are not sure, unplug the USB drive, run the Diskpart and list Disk commands. By doing so, you can get know the number of drives before and after connecting the USB drive.

Step 4: Execute the following commands now.

Select disk X

In the above command, replace “X” with the disk number of the USB drive that you got in Step 2.


Hit Enter key.

Create partition primary

Press Enter key.

Format fs=NTFS Quick

Hit Enter key. This will format the drive with the NTFS file system. If you wish to use FAT32 file system instead of NTFS, please use Format fs=FAT32 Quick command.


Press Enter key to assign a drive letter to the drive.


format USB flash drive via Command Prompt in Windows 10 pic3

You may close the Command Prompt window now. The USB drive should now appear in This PC.

Read 840 times
Dylan Austin


Whenever I have a problem, I sing. Then I realize my voice is worse than my problem.

We use cookies to improve our website. By continuing to use this website, you are giving consent to cookies being used. More details…