How to Format Hard Drive from Command Prompt?

July 9, 2018

This article will shows you how to format disk from Command Prompt in Windows 10/8/7 when your hard drive, SD card or USB flash drive not recognized by your computer.

Help! I’m unable to format my hard drive

Case 1: “To backup some files on my local disk, I connected an external USB hard drive to my computer. I was prompted to format it before using it. But when I tried to format it within File Explorer, I received an error message – Windows was unable to complete the format.

Case 2: My hard drive Windows installed is full, thus I want to format it and reinstall operating system& applications. But when I format hard drive system partition in Disk Management, I found that the option of “Format…” grayed out.

Format hard drive from Command Prompt

When the external hard drive becomes raw, it is possible that the file system of it is damaged. At this point, you can try to format disk from Command Prompt. It is not recommend to use “format f: /fs: ntfs” command to format hard drive, there are changes that it will fail. Follow the steps given below:

Note: Formatting will erase all data on the external hard drive.

In the Search box, input “command prompt”, right click Command Prompt among listed results and choose “Run as administrator”.

In Command Prompt window, input “diskpart” and hit Enter key. Then, type the following commands in order and hit Enter after each one.

  • list disk

  • select disk m, “m” refers to the number of your disk that will be formatted

  • clean

  • create partition primary

  • format fs=ntfs quick, where “ntfs” can be replaced with fat32 or exfat according to your own demand.

Format Hard Drive from Command Prompt in Windows

After successfully format the hard drive to a wanted file system, input exit and hit Enter to close Command Prompt window. Then, assign a drive letter in Disk Management to it and you are able to access and open it from File Explorer to backup your files on local disk.

PS.: You can follow the steps above to format SD card or USB flash drive from Command Prompt in Windows 7/8/10.

Format hard drive from Command Prompt in BIOS

If you use “format c: /fs:ntfs” to format hard drive Windows installed on from Command Prompt in Windows, you’ll receive see the message that Format cannot run because the volume is use by another process when you format the volume that holds operating system.

Unable to Format C Drive Command Prompt

Here you can format hard drive partition that contains operating system from Command Prompt in BIOS with Windows Setup CD/DVD. Let’s have a closer look.

1. Insert Windows installation media into the computer and boot from it.

2. Waiting for “Windows is loading files…” and “Starting Windows” screens to finish.

3. Determine “Language to install”, “Time and currency format” and “Keyboard or input method”; then, click “Next”.

3. In the first Windows installation screen, click “Repair your computer”. Then, select operating system and click “Next” button.

4. In the System Options window, choose “Command Prompt”.

5. In Command Prompt window, type “format c: /fs:ntfs” and hit “Enter”.

Format external drive or internal hard drive via AOMEI Partition Assistant

It is acceptable to format raw external drive from Command Prompt in Windows or format internal hard drive system partition from Command Prompt in BIOS. But for some users who are unfamiliar with computer knowledge, it is not so easy to operate. At this point, AOMEI Partition Assistant is highly recommended due to its powerful functions and easy operating. Let’s see how it works.

Format raw external drive including external hard drive, USB flash rive and SD card

Step 1. Free download, install and run AOMEI Partition Assistant. Right click the external hard drive partition and choose “Format Partition”.

Format Partition

Step 2. In the following small window, choose one among listed file systems and click “OK”. You can also to change cluster size or add partition label.

Choose File System

Step 3. Confirm operation and click “Apply” and “Proceed” to execute it.

Apply Proceed

Format the partition holding operating system on the internal hard drive

Step 1. Connect a USB drive to your computer and run AOMEI Partition Assistant. In the main interface, click “Make Bootable Media” and follow the next prompts to create a bootable media.

Step 2. Reboot computer and enter BIOS to boot your computer from the bootable USB drive created via AOMEI Partition Assistant.

Boot from USB Drive

Step 3. Wait for the main interface of AOMEI Partition Assistant to appear. Right click internal hard drive system partition and choose “Format Partition”. And the followingsteps are as same as formatting the partition on external hard drive.


From all above, you can realize how to format hard drive from Command Prompt in Windows or form BIOS. You can choose proper way to format hard drive partition from Command Prompt based on specific situation. If you are a green hand in computer, you can turn to AOMEI Partition Assistant to format external or internal hard drive simply and successfully. And you can make use of partassist.exe utility if you upgrade AOMEI Partition Assistant to Professional.