This article was co-authored by wikiHow staff writer, Darlene Antonelli, MA. Darlene Antonelli is a Technology Writer and Editor for wikiHow. Darlene has experience teaching college courses, writing technology-related articles, and working hands-on in the technology field. She earned an MA in Writing from Rowan University in 2012 and wrote her thesis on online communities and the personalities curated in such communities.
This article has been viewed 113,504 times.
Learn more...
If you're getting errors when trying to format your USB flash drive in Windows File Explorer (such as "Windows was unable to complete the format"), you can still format the drive at the command prompt. This wikiHow article will teach you how to erase and reformat your flash drive using the DiskPart tool in CMD.
Steps
-
1Plug your USB drive into your computer. Plug it into one of the various USB ports on your computer to continue.
- Normally, you'd format a USB drive by right-clicking it and selecting Format from the menu. You'll only use Command Prompt if that other method does not work.
- You can also use this method if you can't see the USB drive in File Explorer.
-
2Open Command Prompt as an administrator. To do this, press the Win key on your keyboard and type "cmd" to search for the program.
- Click Run as Administrator from the results list that appears.
Advertisement -
3Type "
diskpart
" and press ↵ Enter. You'll see some feedback about your computer and initiates the DiskPart utility. -
4Type "
list disk
" and press ↵ Enter. In the list, you should be able to determine which listed disk is your USB. -
5Type "
select disk [Your disk]
" and press ↵ Enter. From the disk list, you'll need to replace the[Your disk]
line with your disk number.- For example, if your USB is located in disk 2, you'd enter "
select disk 2
." - Once the command is accepted, you'll see "[Your disk] is now the selected disk."
- For example, if your USB is located in disk 2, you'd enter "
-
6Type "
clean
" and press ↵ Enter. Wait a little bit while Command Prompt formats your USB drive.- You'll see "DiskPart succeeded in cleaning the disk" when it's finished.
-
7Type "
create partition primary
" and press ↵ Enter. You'll need to do this before you can further format your USB drive.- Command Prompt will display "DiskPart succeeded in creating the specified partition" when it's done.
-
8Type "
format fs=ntfs
" and press ↵ Enter. This command will tell your USB drive to format with ntfs format. You can also use fat32 or exfat instead by replacing "ntfs" in the command.- You'll see "DiskPart successfully formatted the volume" when it's finished.
-
9Type "
exit
" and press Enter. This will exit the DiskPart program so you can continue using the USB drive or disconnect it from your computer.- If you want to assign a specific letter to that drive, enter "
assign letter=h
" before you exit the DiskPart utility.
- If you want to assign a specific letter to that drive, enter "
About This Article
1. Plug your USB drive into your computer.
2. Open Command Prompt as an administrator.
3. Type "diskpart" and press Enter.
4. Type "list disk" and press Enter.
5. Type "select disk [Your disk]" and press Enter.
6. Type "clean" and press Enter.
7. Type "create partition primary" and press Enter.
8. Type "format fs=ntfs" and press Enter.
9. Type "exit" and press Enter.