Help - Search - Members - Calendar
Full Version: Quick Command To Erase Contents Of Hd
The CD Forum > The CD Forum > Windows PE
Rootman
Ripped pretty much intact from the PECD2HD plugin. I find it useful sometimes, especially when Ghost32 complains that is can't lock the drive when there is weird partitions on the destination drive.

It consists of 3 files and relies on the abilty of PE's disk management to be in working order and DISKPART.EXE to be present.

cleanhd.cmd :

CODE
@echo off
REM Name cleanhd.cmd
echo.
echo Do you want to WIPE ALL PARTITIONS on the 1st hard drive?
echo -- THIS WILL TOTALLY ERASE ALL DATA ON YOUR DISK! --
echo.
set _ok=
set /p _ok=To continue type "YES" (uppercase without quotes) :
if "%_ok%" == "YES" goto _wipeit
goto end

:_wipeit
%SystemDrive%
cd %SystemRoot%\system32
echo.
echo.
diskpart /s cleanhd1.scr
echo.
echo.
echo   Current disk allocations:
echo.
diskpart /s cleanhd2.scr
echo.
echo.
pause
cd \

:end
exit


The first script for diskpart input named cleanhd1.scr :
CODE
select disk 0
clean
exit


The second script to show the user the results, name cleanhd2.scr
CODE
list disk
select disk 0
detail disk


Place all three files in the %SystemRoot%\system32 folder. Make a shortcut to it or NU2 menu entry for it (sorry no included. I use the Explorer shell). Modify the scripts for other drive but remember that the first hard drive is #0, the second is #1 etc.
Xephion
Thanks for the idea Rootman! I've further developed this into a plugin for anyone interested.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.