Skip to main content
    • Articles coming soon
    • Articles coming soon
    • Articles coming soon
    • Articles coming soon
    • Articles coming soon
    • Articles coming soon
    • Articles coming soon
    • Articles coming soon
    • Articles coming soon
    • Articles coming soon
    • Articles coming soon
    • Articles coming soon
    • Articles coming soon
    • Articles coming soon
    • Articles coming soon
    • Articles coming soon
    • Articles coming soon
Print

DiskPart Script to Wipe a Disk –

Create a plain text file (for example, wipe.txt) containing the following commands. Warning: Replace X with your actual target disk number. Running the clean command permanently removes all partition information and data from the selected drive.

select disk X
clean

How to Run the DiskPart Script:

  1. Open Command Prompt as an Administrator.
  2. Run the script using the /s flag pointing to your text file: [1, 2]cmddiskpart /s C:\path\to\wipe.txt Use code with caution.

PowerShell Alternative (Clear-Disk)

To wipe a disk directly using PowerShell in an administrative window, run How to Completely Wipe a Hard Drive Using PowerShell:

Clear-Disk -Number X -RemoveData -RemoveOEM -Confirm:$$false

Use code with caution.

(Change X to your target disk number)

Table of Contents