Skip to main content
Print

Wipe a hard drive with script


@echo off

color 1F

cls

echo ==========================================

echo WIPE-ONLY SCRIPT (no Windows install)

echo If you can read this, the script IS running.

echo ==========================================

echo.

echo Disk layout BEFORE wipe:

echo select disk 0 > "%TEMP%\listdisk.txt"

echo list partition >> "%TEMP%\listdisk.txt"

diskpart /s "%TEMP%\listdisk.txt"

echo.

echo Wiping Disk 0 in 5 seconds... Press Ctrl+C now to abort.

timeout /t 5

echo.

echo Running diskpart clean on Disk 0...

(

echo select disk 0

echo clean

echo exit

) | diskpart

echo.

echo Disk layout AFTER wipe (should show no partitions):

diskpart /s "%TEMP%\listdisk.txt"

echo.

echo ==========================================

echo WIPE COMPLETE.

echo Press any key to continue, or power off the machine now.

echo ==========================================

pause