how to format ssd or hdd with cmd

How to Format Hard Disk Using the Command Prompt (cmd).

We may need to format a hard disk (SSD or HDD) for some unwanted reason. Without further ado, let’s take a look at “How to format a hard disk via a command prompt. (cmd)”.
Note: Before proceeding further, make sure you backup all available data to prevent data loss. Follow the steps below to format a drive.

Step 1: Open Command Prompt As Administrator

First, you have to run the command prompt through the admin. This can be done by following the steps below.

  1. Press windows button form keyboard and type cmd
  2. Then click right button on command prompt
  3. And click on “run as Administrator”

Note: If there is a “blue screen problem” then you need to open the command prompt by directly clicking on the command prompt option.

When the command prompt opens, you will see the following text in the cmd window.

Microsoft Windows [Version 2004]
Copyright  2020 Microsoft Corporation. All Right Reserved.
 
C:\Windows\system32>

Step 2: Disk Part Command

Then need to run the “diskpart” command cmd to show the disk part.

Microsoft Windows [Version 2004]
Copyright  2020 Microsoft Corporation. All Right Reserved.
 
C:\Windows\system32>diskpart

Then Prees the “Enter” button. The result of the “diskpart” command run will look like the following.

Microsoft Windows [Version 2004]
Copyright  2020 Microsoft Corporation. All Right Reserved.
Microsoft DiskPart version 6.1.7600
Copyright  1999-2020 Microsoft Corporation.
On computer: LATITUDE-E7440
DISKPART>

Step 3: List Disk Command

To know the list of memory on the system, you need to run the “list disk” command, as follows.

Microsoft Windows [Version 2004]
Copyright  2020 Microsoft Corporation. All Right Reserved.
Microsoft DiskPart version 6.1.7600
Copyright  1999-2020 Microsoft Corporation.
On computer: LATITUDE-E7440
DISKPART>list disk

Then Prees the “Enter” button. The result of the “list disk” command run will look like the following.

Microsoft Windows [Version 2004]
Copyright  2020 Microsoft Corporation. All Right Reserved.
Microsoft DiskPart version 6.1.7600
Copyright  1999-2020 Microsoft Corporation.
On computer: LATITUDE-E7440
DISKPART>list disk
Disk ###      Status                Size        Free    Dyn     Gpt
--------      ---------             ------      -----   ---     ---
Disk 0	      Online                500 GB      0 B
Disk 1	      No Media              32 GB       0 B
Disk 2	      Online                320 GB      0 B

DISKPART>

Step 4: Select Disk Command

To format the desired disk, you need to select the disk using the “select disk [desired disk number]” command.

Microsoft Windows [Version 2004]
Copyright  2020 Microsoft Corporation. All Right Reserved.
Microsoft DiskPart version 6.1.7600
Copyright  1999-2020 Microsoft Corporation.
On computer: LATITUDE-E7440
DISKPART>list disk
Disk ###      Status                Size        Free    Dyn     Gpt
--------      ---------             ------      -----   ---     ---
Disk 0	      Online                500 GB      0 B
Disk 1	      No Media              32 GB       0 B
Disk 2	      Online                320 GB      0 B

DISKPART>select disk 0

Then press the “Enter” button. The result of the “select disk” command run will look like the following.

Microsoft Windows [Version 2004]
Copyright  2020 Microsoft Corporation. All Right Reserved.
Microsoft DiskPart version 6.1.7600
Copyright  1999-2020 Microsoft Corporation.
On computer: LATITUDE-E7440
DISKPART>list disk
Disk ###      Status                Size        Free    Dyn     Gpt
--------      ---------             ------      -----   ---     ---
Disk 0	      Online                500 GB      0 B
Disk 1	      No Media              32 GB       0 B
Disk 2	      Online                320 GB      0 B

DISKPART>select disk 0
Disk 0 is now the selected disk.
DISKPART>

Step 5: Disk Clean Command

In this step, type “clean“. This command will permanently delete all files and folders, and successfully clean up the disk.

Microsoft Windows [Version 2004]
Copyright  2020 Microsoft Corporation. All Right Reserved.
Microsoft DiskPart version 6.1.7600
Copyright  1999-2020 Microsoft Corporation.
On computer: LATITUDE-E7440
DISKPART>list disk
Disk ###      Status                Size        Free    Dyn     Gpt
--------      ---------             ------      -----   ---     ---
Disk 0	      Online                500 GB      0 B
Disk 1	      No Media              32 GB       0 B
Disk 2	      Online                320 GB      0 B

DISKPART>select disk 0
Disk 0 is now the selected disk.
DISKPART>clean

Then press the “Enter” button. Disk Clean will start. The result will look like the following when clean.

Microsoft Windows [Version 2004]
Copyright  2020 Microsoft Corporation. All Right Reserved.
Microsoft DiskPart version 6.1.7600
Copyright  1999-2020 Microsoft Corporation.
On computer: LATITUDE-E7440
DISKPART>list disk
Disk ###      Status                Size        Free    Dyn     Gpt
--------      ---------             ------      -----   ---     ---
Disk 0	      Online                500 GB      0 B
Disk 1	      No Media              32 GB       0 B
Disk 2	      Online                320 GB      0 B

DISKPART>select disk 0
Disk 0 is now the selected disk.
DISKPART>clean
DiskPart succeeded in cleaning the disk.
DISKPART>

Step 6: Create Partition Primary

To make the drive again accessible, type “create partition primary“.

Microsoft Windows [Version 2004]
Copyright  2020 Microsoft Corporation. All Right Reserved.
Microsoft DiskPart version 6.1.7600
Copyright  1999-2020 Microsoft Corporation.
On computer: LATITUDE-E7440
DISKPART>list disk
Disk ###      Status                Size        Free    Dyn     Gpt
--------      ---------             ------      -----   ---     ---
Disk 0	      Online                500 GB      0 B
Disk 1	      No Media              32 GB       0 B
Disk 2	      Online                320 GB      0 B

DISKPART>select disk 0
Disk 0 is now the selected disk.
DISKPART>clean
DiskPart succeeded in cleaning the disk.
DISKPART>create partition primary
DiskPart succeeded in creating the specified partition.
DISKPART>

Step 7: Format the Disk

Now format the drive with FAT or NTFS file system. Type “format fs=ntfsand press Enter.

Microsoft Windows [Version 2004]
Copyright  2020 Microsoft Corporation. All Right Reserved.
Microsoft DiskPart version 6.1.7600
Copyright  1999-2020 Microsoft Corporation.
On computer: LATITUDE-E7440
DISKPART>list disk
Disk ###      Status                Size        Free    Dyn     Gpt
--------      ---------             ------      -----   ---     ---
Disk 0	      Online                500 GB      0 B
Disk 1	      No Media              32 GB       0 B
Disk 2	      Online                320 GB      0 B

DISKPART>select disk 0
Disk 0 is now the selected disk.
DISKPART>clean
DiskPart succeeded in cleaning the disk.
DISKPART>create partition primary
DiskPart succeeded in creating the specified partition.
DISKPART>format fs=ntfs
0 percent completed

When the disc is 100% formatted, you need to follow step 8.

Step 8: Format the Disk

To assign a drive letter, you can type “assign as shown below.

Microsoft Windows [Version 2004]
Copyright  2020 Microsoft Corporation. All Right Reserved.
Microsoft DiskPart version 6.1.7600
Copyright  1999-2020 Microsoft Corporation.
On computer: LATITUDE-E7440
DISKPART>list disk
Disk ###      Status                Size        Free    Dyn     Gpt
--------      ---------             ------      -----   ---     ---
Disk 0	      Online                500 GB      0 B
Disk 1	      No Media              32 GB       0 B
Disk 2	      Online                320 GB      0 B

DISKPART>select disk 0
Disk 0 is now the selected disk.
DISKPART>clean
DiskPart succeeded in cleaning the disk.
DISKPART>create partition primary
DiskPart succeeded in creating the specified partition.
DISKPART>format fs=ntfs
0 percent completed
DISKPART>assign
DiskPart successfully assigned the drive letter or mount point.
DISKPART>

Thank you for reading this tutorial. Hopefully, from now on you can format the hard drive using the command prompt.

We try to keep the content of various topics published in our blog error-free. Even then, if you see any error in your eyes, please let us know in the comments. We will be grateful to you.

3 thoughts on “How to Format Hard Disk Using the Command Prompt (cmd).

Leave a Reply