Computers, Laptops & Tablets Accessories & Hardware 43 43 people found this article helpful How to Use the Format Command to Write Zeros to a Hard Drive Wipe a hard drive from the Command Prompt by Tim Fisher General Manager, VP, Lifewire.com Tim Fisher has 30+ years' professional technology support experience. He writes troubleshooting content and is the General Manager of Lifewire. our editorial process Facebook Twitter LinkedIn Tim Fisher Updated on November 13, 2019 Accessories & Hardware HDD & SSD The Quick Guide to Webcams Keyboards & Mice Monitors Cards Printers & Scanners Raspberry Pi Tweet Share Email One easy way to write zeros to a hard drive to erase all the data, is to format the drive in a special way using the format command from the Command Prompt. The format command gained write-zero abilities beginning in Windows Vista, so if you have an older operating system, you won't be able to use the format command as data destruction software. A System Repair Disc can be created from any working Windows 7 computer and can then be used to write zeros to any drive using the included format command, including the primary drive, no matter what Windows operating system is on the computer. A System Repair Disc does not install Windows 7 and you will not need a product key to use a System Repair Disc. It could take several minutes to several hours to write zeros to a hard drive via the format command How to Zero-Fill a Hard Drive With the Format Command Since you can write zeros to a hard drive with the format command both from within Windows 7 and Windows Vista and from outside the operating system, we've created two ways to proceed through these instructions: Start at Step 1 if you need to write zeros to the primary drive, usually C, of any Windows operating system OR if you want to write zeros to any drive on a computer with Windows XP or earlier. Start at Step 6 if you need to write zeros to a drive other than the primary drive in Windows Vista or later; you'll need to have an elevated Command Prompt window open and ready. Create a System Repair Disc in Windows 7. As we mentioned earlier, you'll need access to a Windows 7 computer to create a System Repair Disc. However, it doesn't need to be your Windows 7 computer. If you don't have a Windows 7 PC then find a friend that does and create a System Repair Disc from his or her computer. If you don't already have or can't find a way to create a System Repair Disc then you won't be able to write zeros to a drive in this way. See our Free Data Destruction Software Programs list for more options. If you have a Windows Vista or Windows 7 Setup DVD, you can boot to it in lieu of creating a System Repair Disc. The directions from this point forward using a setup disc will be generally the same. Boot from the System Repair Disc and watch for the Press any key to boot from CD or DVD... message after your computer turns on, and be sure to do that. If you don't see this message but instead see the Windows is loading files... message, that's fine. Wait for the Windows is loading files... screen. When it's over, you should see a System Recovery Options box. Change any language or keyboard input methods you need to and then select Next >. Don't worry about the "loading files" message...nothing is being installed anywhere on your computer. System Recovery Options is just starting, which is needed to get to the Command Prompt and ultimately to write zeros to your hard drive. A little dialog box appears next that says "Searching for Windows installations...". After several seconds, it will disappear and you'll be taken to a System Recovery Options window with two options. Choose Use recovery tools that can help fix problems starting Windows. Select an operating system to repair. and then select Next >. Your operating system may or may not be listed. If you're using another operating system like Windows XP or Linux, nothing will show up here — and that's OK. You do not need a compatible operating system on this computer to write zeros over the data on the hard drive. Select Command Prompt from the System Recovery Options screen. This is a fully functional version of the Command Prompt and contains most of the commands you'd expect to be available from the Command Prompt in an installed version of Windows 7. This, of course, includes the format command. At the prompt, type the following, followed by Enter: format e: /fs:NTFS /p:2 The format command used in this way will format the E drive with the NTFS file system and write zeros to every sector of the drive twice. If you're formatting a different drive, change e to whatever drive letter you need. A single pass of zeros to a hard drive should prevent all software based file recovery programs from extracting information from the drive, which the format command in Windows 7 and Vista does by default. However, you might do two passes via this method just to be safe. Even better, if you'd like to protect yourself from more invasive ways of recovering data, choose a true data destruction program with more advanced options. If you'd like to format using a different file system or in a different way, you can read more about the format command here: Format Command Details. Enter the volume label of the drive you're formatting when asked, and then press Enter. The volume label is not case sensitive. Enter current volume label for drive E: If you don't know the volume label, cancel the format using Ctrl+C and then see How to Find the Volume Label of a Drive From the Command Prompt. If the drive you're formatting doesn't have a label then, logically, you won't be asked to enter it. So, if you don't see this message it just means that the drive you're formatting doesn't have a name, which is fine. Just move on to Step 8. Type Y and then press Enter when prompted with the following warning: WARNING, ALL DATA ON NON-REMOVABLE DISK DRIVE E: WILL BE LOST! Proceed with Format (Y/N)? You can not undo a format! Be very sure that you want to format and permanently erase this drive! If you're formatting your primary drive, you will remove your operating system and your computer will not work again until you install a new one. Wait while the format completes. Formatting a drive of any size may take a long time. Formatting a large drive may take a very long time. Formatting a large drive with multiple write-zero passes may take a very, very long time. If the drive you're formatting happens to be very large and/or you've chosen to make several write-zero passes, don't worry if the percent completed doesn't even reach 1 percent for several seconds or even several minutes. After the format, you'll be prompted to enter a Volume label. Type a name for the drive, or don't, and then press Enter. Wait while Creating file system structures is displayed on the screen. Once the prompt returns, repeat the above steps on any other partitions on this physical hard drive. You can't consider the data on an entire physical hard disk destroyed unless you actually format all the drives on the disk using this method. You can now remove the System Repair Disc and turn off your computer. If you've used the format command from within Windows, just close the Command Prompt. If you try to boot to a drive that you've erased all the information from, it will not work because there's no longer anything there to load. What you'll get instead is a "BOOTMGR is missing" or an "NTLDR is missing" error message, meaning there was no operating system found. With all the data replaced by zeros, there's no longer any information to be found on your hard drive by a file recovery program.