Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: Using Diskpart

10 Apr 2010   #1
Bare Foot Kid
Microsoft MVP

W 7 64-bit Ultimate
Using Diskpart

Hello everyone.

What I would like is to do is a "secure erase" (write zeroes) to a partition of a HDD before a clean install of Windows 7. If I were to boot to a Command Prompt at Startup would the series of commands in the snip below secure erase (zero) the partition; then I could clean install Windows 7 to that same partition.

Does a full format do a secure erase to the partition? I don't really want to use a 3rd party prog. to do it if Diskpart will.

I hope y'all understand what I'm asking.

Using Diskpart-format2.jpg

My System SpecsSystem Spec
10 Apr 2010   #2

64-bit Windows 10 Pro

Hello Ted,

You can use the Clean All command to "secure erase" a hard drive to completely wipe it clean. :)

Hope this helps,
My System SpecsSystem Spec
10 Apr 2010   #3
Bare Foot Kid
Microsoft MVP

W 7 64-bit Ultimate

Hello Brink.

Thanks for the reply.

I've been experimenting with that and a "clean" and a "clean all" command remove the partition structure from the HDD and make it "unallocated" space and I don't want that to happen, I want to do a secure erase to a partition on a HDD with data on other partitions on the HDD and not lose that data.
My System SpecsSystem Spec

10 Apr 2010   #4

64-bit Windows 10 Pro

While the "format" command is not as a "secure erase" as using the "Clean All" command, if you "format" and install Windows on top of it, it should pretty much wipe out any traces of data that was on the HDD.

Quick Format - only rewrites the boot record of the media and makes the whole space available for writing data. Althought physically, previous data is still present, only marked as free space.

Full Format - formats everything as well as test (dskchk) each sector for Read/Write problems. Sectors with problems are marked as bad. Since it tests every sector, depending on the hard drive size and computer speed may take many minutes or hours to do.
My System SpecsSystem Spec
10 Apr 2010   #5
Bare Foot Kid
Microsoft MVP

W 7 64-bit Ultimate

So any data on the partition would be pretty much un-recoverable after a full format and a clean install?

Thank you Shawn. :)
My System SpecsSystem Spec
10 Apr 2010   #6

64-bit Windows 10 Pro

I'm sure that the government will still have a way to recover some data from it if push came to shove, but it would be practically unrecoverable for your average joe.

If you truly need it wiped cleaned, then it's either the "Clean All" command, or a 3rd party disk scrubbing program with several passes that would need to be used to do so.
My System SpecsSystem Spec
10 Apr 2010   #7
Bare Foot Kid
Microsoft MVP

W 7 64-bit Ultimate

I realized after I posted that that I was making it sound as though I have "stuff" I want hidden, I don't, I just want a clean slate when I do clean installs from now on.

Thank you very much Shawn. :)

I also want to say "thank you" to Jonathan_King for his help with this also.
My System SpecsSystem Spec
10 Apr 2010   #8

Win 7 Ultimate 32bit

You don't have to be a criminal or a spy to want a truly clean drive

There is a little known command built into all modern drives firmware.....

CMRR - Secure Erase

HDDerase.exe is a DOS-based utility that securely erases "sanitizes" all data
on ATA hard disk drives in Intel architecture computers (PCs). It offers the
option to run the drive internal secure erase command, security erase unit,
based on the ATA specification by the T13 technical committee.
This does not work on USB or SCSI drives.

It has been my understanding over the years of researching that the following refers to Bad Sectors as well..

Q: What is the difference between secure erase and enhanced secure erase?

A: Secure erase overwrites all user data areas with binary zeroes. Enhanced
secure erase writes predetermined data patterns (set by the manufacturer) to
all user data areas, including sectors that are no longer in use due to
reallocation. ***NOTE: the enhanced secure erase option is not supported by
all ATA drives.
No other software or method will also erase data on bad sectors.

So even if you erase a drive of data. Any data that was written to a sector that has
been marked bad can be recovered using exotic lab techniques for data recovery.

There are many devices now that are certified and can claim full certification for
things like HIPAA and other very sensitives data erasure needs that only use the
Internal Wipe Command to completely erase all data from a drive that could be
re-used in any capacity.
Which makes the Internal Wipe Command very favorable for anyone who is about to trash,
or resell a system that they may not want sensitive data to be recovered from.

Keep in mind that this is a full disk erasure.
My System SpecsSystem Spec
10 Apr 2010   #9

Microsoft Community Contributor Award Recipient

Windows 7 Home Premium SP1, 64-bit


Sounds interesting. Have you actually used this app? I have downloaded it, but gone no further.

It appears that the EXE file is actually called hdderase.exe rather than Secure Erase?

I guess you have to burn it to a bootable CDR and then boot from it.

Any issues and do you have an estimate of how long this takes to run on a 1 TB drive scheduled for disposal?

Barefoot Kid:

Here are the commands I use with Diskpart, after hitting Shift F10 during setup:

list disk (to show the ID number of the hard disk to partition, normally Disk 0)

select disk 0 (change 0 to another number if applicable)


create partition primary size=80000 (create a partition with 80 GB space; to use the entire disk as one partition, omit the “size=value” parameter switch; use a similar command to create more partitions if needed or create in Windows 7 after installation)

select partition 1


format fs=ntfs quick

My System SpecsSystem Spec
10 Apr 2010   #10

64-bit Windows 10 Pro

Hello Ignatzatsonic,

The data on the HDD is not written over using the clean or format quick command. It is only marked as being deleted and can be written over when new data is written/saved to the HDD next. You would have to use the clean all command for a secure erase to have all the data written over with 0's on the HDD instead though.

Disk - Clean and Clean All with Diskpart Command
My System SpecsSystem Spec

 Using Diskpart

Thread Tools

Similar help and support threads
Thread Forum
Using Diskpart
Hi everyone, I'm new here so please forgive me if I have explained this badly or if I haven't provided enough information. Using "Diskpart" , I like to Change The Label of The Partition to Date of today? Example: diskpart format fs=ntfs label=(06/25/2015) quick Thanks
Performance & Maintenance
I am trying to do a diskpart/clean all via command prompt. Should the command prompt opened via repair menu at startup be at c:\windows\system32 or x:\sources or doesn't matter? Here is the tutorial that I am doing this according to: ...
General Discussion
Does my ssd diskpart looks ok ?
Does my ssd diskpart looks ok ? wondering no issues but ..
Installation & Setup
DiskPart help
Ok i couldn't mark my D partition as active because there wasn't a "Mark as Active" in diskmgmt.msc. so i tried to do it in command Prompt like it is described here. But the problem is that there is 3 partitions listed...
Installation & Setup
Hi everyone. I have an external harddrive that is unreadable, so I used DBAN to clean it. I think it fixed the disk. Unfortunately, I cannot open it or assign a drive letter. I was trying to use diskpart, but it doesn't work. I am uploading a screenshot of the problem. Any assistance will be...
Hardware & Devices

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 06:28.
Twitter Facebook Google+