How to wipe a hard drive using Diskpart and Format

by Mitch Tulloch [Published on 25 Jan. 2012 / Last Updated on 25 Jan. 2012]

Advertisement GFI LanGuard your virtual security consultant. Scan your LAN for any vulnerability and automate patch management for Windows, Mac OS & Linux. Get your FREE trial now!

GFI LanGuard is the essential tool for sysadmins:

  • Automate multiple OS patching
  • Scan for vulnerabilities
  • Audit hardware and software
  • Run compliance reports

Your FREE trial awaits:

Download a 30 day, fully functional, free trial which also includes GFI technical support.

No credit card required

Explains how to wipe a hard drive using the Diskpart and Format commands.

There are various tools out there you can buy or download for wiping hard drives, but it's easy to do this using the built-in Windows commands Diskpart and Format. Just take the drive you want to wipe out of the computer and insert it into another computer, then open a command prompt window on the second computer and type the following commands:


Select Disk N

In the above command N should be the disk number of the disk you are going to wipe.


Create Partition Primary



Now type the following command where X is the drive letter assigned to the new partition using the Assign command above:

Format X: /p:1 /v:CleanDisk /y

By scripting the above series of commands you can easily wipe all data from the drive in a single pass.

Mitch Tulloch is a seven-time recipient of the Microsoft Most Valuable Professional (MVP) award and widely recognized expert on Windows administration, deployment and virtualization. For more tips by Mitch you can follow him on Twitter or friend him on Facebook.

See Also

The Author — Mitch Tulloch

Mitch Tulloch is a well-known expert on Windows Server administration and cloud computing technologies. He has published over a thousand articles on information technology topics and has written, contributed to or been series editor for over 50 books.

Featured Links