How to wipe a hard drive using Diskpart and Format a primary partition on Microsoft Windows

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.