0% found this document useful (0 votes)
13 views

How To Format A USB Using Command Prompt (CMD) On Windows

Uploaded by

Sreenivas Kaza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

How To Format A USB Using Command Prompt (CMD) On Windows

Uploaded by

Sreenivas Kaza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

How to Format a USB Using CMD (Command

Prompt)
A step-by-step guide to use the Command Prompt to reformat and clean a flash drive
Written by Rain Kengly
Last Updated: November 10, 2023 Fact Checked

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 using the Command
Prompt. This wikiHow article will teach you how to erase and reformat your flash drive using the
DiskPart tool in CMD using your Windows computer or laptop.

Things You Should Know

Plug the USB into your computer, then run CMD as Administrator.
After using the commands "diskpart", "list disk", and "select disk", type "clean" and press
"Enter".
Use the command "create partition primary" to further format your USB drive.

Steps

Plug your USB drive into your computer. Plug it into one of the various USB ports on
1 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.

Open Command Prompt as an administrator. To do this, press the Win key on your
2 keyboard and type "cmd" to search for the program.[1]
Click Run as Administrator from the results list that appears.
Advertisement

Type "diskpart" and press ↵ Enter . You'll see some feedback about your computer
3
and initiates the DiskPart utility.[2]
Type "list disk" and press ↵ Enter . In the list, you should be able to determine
4
which listed disk is your USB.[3]

Type "select disk [Your disk]" and press ↵ Enter . From the disk list, you'll need
5
to replace the [Your disk] line with your disk number.[4]
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."

Type "clean" and press ↵ Enter . Wait a little bit while Command Prompt formats your
6
USB drive.[5]
You'll see "DiskPart succeeded in cleaning the disk" when it's finished.

Type "create partition primary" and press ↵ Enter . You'll need to do this before
7
you can further format your USB drive.[6]
Command Prompt will display "DiskPart succeeded in creating the specified partition"
when it's done.

Type "format fs=ntfs" and press ↵ Enter . This command will tell your USB drive to
8 format with ntfs format. You can also use fat32 or exfat instead by replacing "ntfs" in the
command.[7]
You'll see "DiskPart successfully formatted the volume" when it's finished.

Type "assign letter=[letter]" and press ↵ Enter . This command will assign a
9
specific letter to your drive.[8]
In place of [letter], enter a single letter. For example, you'd enter "assign letter=h".

Type "exit" and press Enter . This will exit the DiskPart program so you can
10
continue using the USB drive to save files or disconnect it from your computer.[9]

Advertisement

Tips
References

1. https://www.tomshardware.com/news/format-hard-drive-command-prompt,37632.html
2. https://learn.microsoft.com/en-us/windows-server-essentials/install/create-a-bootable-usb-
flash-drive
3. https://learn.microsoft.com/en-us/windows-server-essentials/install/create-a-bootable-usb-
flash-drive
4. https://www.windowscentral.com/how-clean-and-format-storage-drive-using-diskpart-
windows-10
5. https://www.tomshardware.com/news/format-hard-drive-command-prompt,37632.html
6. https://www.windowscentral.com/how-clean-and-format-storage-drive-using-diskpart-
windows-10
7. https://kb.iu.edu/d/bccm
8. https://kb.iu.edu/d/bccm
9. https://kb.iu.edu/d/bccm
Advertisement

You might also like