WTO

How to Wipe a Hard Drive Windows 11 Command Prompt – Complete Guide

09 Jul 2026
SysTools Group

Share article

Need to wipe a hard drive a few times? Maybe you are prepping a computer for sale, erasing confidential information, repairing bad sectors, or reinstalling the OS. One of the most reliable methods for doing so in Windows 11 is using the Command Prompt as mentioned above in such cases. Wondering how to wipe hard drive Windows 11 command prompt? This guide tells you the details with steps.

Command Prompt comes with some handy inbuilt utilities that you can use to wipe disks without having to install third-party software. Due to the fact that the process is irreversible, it is essential to pay close attention to each step.

Method 1: Wipe a Hard Drive Using DiskPart in Command Prompt

One of the most efficient approaches on just how to clear your hard disk Windows 11 command prompt is by using the DiskPart energy. DiskPart is a command-line disk partitioning utility

Step 1 — Open Permissions Command Prompt as AdminClick the Start menu.

Search for Command Prompt Commands Or Program

R- Click it and select Run as Administrator.

Disk management commands will always need higher privileges, so this requires administrator access.

Step 2: Launch DiskPartThen in command prompt window, write this command:

diskpart

Press Enter.

This command loads the DiskPart environment for storage device management.

Step 3: View Available DisksThey you can see all connected drives by typing:

list disk

Press Enter.

It will show you all the storage drives connected to the system with their size. Be very careful to select the drive you wish to wipe.

It is crucial in this step while discussing how to wipe a hard drive Windows 11 command prompt and selecting a wrong disk can wipe off the wrong data permanently.

Step 4: Choose the Destination DiskTo choose the disk you wish to erase, type:

select disk X

Where X is the number of the disk displayed in the previous command.

Example:

select disk 1

DiskPart will say the disk now is selected.

Step 5: Clean the Hard DriveNow enter the following command:

clean

Press Enter.

Issuance of this command will delete whole partition & formatting information on chosen disk It is a good drive wiper that removes everything in the drive and makes it unallocated.

This command is popular among users who are looking for how to wipe a hard drive Windows 11 command prompt as it can wipe a full disk very fast.

Step 6 (Optional) — Secure WipeTo overwrite the data more thoroughly, you can use this:

clean all

A clean all will write zeros on the whole disk Unlike clean which is more of a basic command that give up the disk but clean all will write zeros in the entire disk so, it will be way difficult on the part of data recovery. This, however, can take some time depending on how big the drive is.

Step 7: Exit DiskPartAfter the wipe has finished, type:

exit

Type exit to get out of DiskPart and then exit again to close Command Prompt.

By this point, teaching the command prompt for just how to remove a hard disk drive Windows 11 is done. At this stage, the disk will show unallocated and can either be repartitioned or used at as a new OS.

Alternative Solution to Wipe Hard Drive

Command Prompt does the job, but many users prefer the convenience of graphical tools when it comes to erasing disks. In those situations, SysTools Data Wipe Software can be used as the last resort. It has a simple GUI, but it will take care of your hard drives permanently using the latest wiping algorithms. For those who want more data security or do not use the command line–this option can come in handy.

Article tags

Photo by Markus Spiske on Unsplash