How to Zero-Fill a Drive Using DiskPart

If you want to completely wipe a drive by writing zeros to every sector, you can use DiskPart’s clean all
command. This is useful for securely erasing data before selling, repurposing, or disposing of a drive.
⚠️ WARNING
This will erase everything on the selected disk. All partitions, data, and boot sectors will be permanently removed. Make absolutely sure you’re selecting the correct drive.
✅ Step-by-Step Instructions
- Open Command Prompt as Administrator
Click Start, typecmd
, right-click it, and choose “Run as administrator.” - Launch DiskPart
diskpart
- List all disks
list disk
Identify the disk you want to wipe based on its size. - Select the correct disk
select disk X
ReplaceX
with the number of the disk you want to erase. - Double-check your selection (optional but smart)
detail disk
Confirm it’s the correct one before continuing. - Zero-fill the drive
clean all
This writes zeros to the entire drive. It may take a while depending on the drive size.
🧠 Notes
clean
only removes the partition table — it does not overwrite data.clean all
writes zeros to the entire disk — this is a proper data wipe.- For DoD-style multi-pass wiping, you’ll need a third-party tool like DBAN or a PowerShell script loop.