How to Erase My Entire Hard Drive with Command Prompt

by Jedadiah Casey

Microsoft Windows features a powerful command line utility called "diskpart" that is capable of many different functions for hard drives. Some of the included functions include partitioning, formatting, clearing and assigning different areas of the hard drive in a computer. Operations done with "diskpart" can be either destructive or non-destructive. You can erase your entire hard drive with the command prompt by booting from the Windows installation disc and running the "diskpart" utility.

Step 1

Boot the computer from the Windows installation disc.

Step 2

Click "Next" at the first prompt.

Step 3

Click "Repair your computer."

Step 4

Click "Next."

Step 5

Click "Command Prompt."

Step 6

Type "diskpart" without quotes, then press "Enter."

Step 7

Type "list disk" without quotes, then press "Enter."

Step 8

Type "select disk 0" without quotes and replacing "0" with the actual number of the drive you wish to erase.

Step 9

Type "clean" without quotes, then press "Enter." The disk is now completely erased.

Restart the computer.


  • Be sure to back up any important data before using the diskpart command.


  • You can run diskpart from an installed Windows system without booting from the install disc, but you cannot erase the primary hard drive running Windows unless you boot from the disc. The diskpart utility is accessed from the command prompt utility under "Accessories."

About the Author

Jedadiah Casey started writing professionally in 2007, with articles published in "The Flagler Times" newspaper. He has more than 20 years of experience with computers and networking. Casey holds a Bachelor of Science in information systems from the University of Central Florida, as well as professional industry certifications.

More Articles