How to Completely Wipe, Format and Zero Out Your Hard Drive Before Installing Windows


**Disclosure: This post contains affiliate links. If you make a purchase through these links, we may earn a small commission at no extra cost to you.

Computer hardware issues are not too common unfortunately but when they do happen, they can be devastating or at least frustrating and expensive! Whether you bought your computer from a store or built it yourself, there is still a chance you will run into some type of problem.

When you start having issues with your hard drive then it can be hard to tell if it’s a pending hard drive failure or just some type of Windows filesystem corruption causing your problem. You may get disk read or write errors or even have your computer freeze or crash on you. If you think it’s just a problem with Windows and not the physical drive itself, you can wipe the drive and then do a clean Windows installation. But if you want to take an extra step to make sure the drive is ok to use, you have an option. In this article, we will be showing you how to completely wipe, format and zero out your hard drive before installing Windows.

To begin the process, you will first need to create a bootable Windows flash drive using your favorite USB OS creator software. Then you can boot your computer with it as if you were going to install Windows.

When you get to the first screen of the installation wizard, you can press Shift+F10 on your computer to open a command prompt.

Windows 11 Installation Setup Screen

Shift + F10 Open Command Prompt Windows Setup

From this command prompt, you will need to type in the following commands one at a time to wipe and repartition your hard drive. We will first be using the DiskPart command which is used to configure the hard drives on your computer via the command line.

To begin, simply type in diskpart at the prompt and press enter. You will then be taken to the diskpart prompt where you can type the rest of the commands.

diskpart

list disk (shows the disks on your computer)

select disk 0 (or your target drive number)

clean (removes all data and partitions from the drive)

convert gpt (used to convert the drive to GPT for Windows 11)

create partition primary

select partition 1

assign letter=C (or another letter)

exit

How to Completely Wipe, Format and Zero Out Your Hard Drive Before Installing Windows

Once you exit the diskpart prompt, you can then type the following command to format your new partition and perform a single pass of writing zeros to the drive. You can change the number for the /p:1 to another number if you want to make more passes but it will make the process take longer.

format C: /fs:ntfs /p:1

Here is what the /p:1 switch does.

  • Writes zeros to every sector of the partition
  • Scans for bad sectors and mark them
  • Flushes out lingering data, malware, or corruption

You will then need to type the letter Y to agree to all the data being deleted from the disk but there will not be anything on there to worry about. The format process will then take several minutes to complete.

How to Completely Wipe, Format and Zero Out Your Hard Drive Before Installing Windows

You can then give the volume a label such as Windows when you are done or leave it blank. Then you can close the command prompt window by clicking on the X to go back to the Windows installation. From here simply go through all the usual steps required to install Windows until you get to the section where you choose a drive to install Windows on.

Normally you would just need to choose your new partition and click on the Next button to have Windows installed on your freshly formatted drive. But you may run into an error that says “We couldn’t create a new partition or locate an existing one. For more information, see the Setup log files”.

If that happens, you can simply click on your new partition and then have Windows create a new one during the installation.

How to Completely Wipe, Format and Zero Out Your Hard Drive Before Installing Windows

You may also come across and error that says “There is an error selecting this partition for install. Please select a different partition or refresh selections.” This can be caused because Windows needs space to create an EFI System Partition and the drive does not have any unallocated space left on it.

There is an error selecting this partition for install. Please select a different partition or refresh selections.

If this happens, you will need to click the OK button and then close out of the Windows installation screen which should then reboot your computer to start the installation process over again.

Then when you get to the screen where it asks where do you want to install Windows, you can delete the partition and have Windows create its own during the installation process.

How to Completely Wipe, Format and Zero Out Your Hard Drive Before Installing Windows

Then you should be able to complete the Windows installation and then use your computer to see if you are still getting any disk errors or other problems. If not, then it was most likely a case of Windows filesystem corruption or other drive corruption. But if the issue is still there, then you may be looking at a faulty hard drive.

For additional training resources, check out our online IT training courses.

Check out our extensive IT book series.

Related Posts

© 2025 Online Computer Tips
Website by Anvil Zephyr