-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDrive-Wipe.cmd
44 lines (33 loc) · 1.09 KB
/
Drive-Wipe.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
@ECHO OFF
::Created Version 1.0 by Carlos Martinez 9/4/2017
::Wipe Drive v2.0 12/31/2018
::The variable Dn: value has been passed from Drive-Initializer.bat
Title Disk %Dn% Erasing...
::start first function
goto StartWipe
::Function to start wipping the drive
:StartWipe
diskpart /s "Diskpart\Drive-Wipe.txt"
cls
::Call SDelete to wipe the drive in 3 passes, free space, zero space
SDelete\sdelete64.exe -p 3 -c -z %Dn%
::Create active partition for MSDOS boot
diskpart /s Diskpart\Drive-Boot.txt
::Change the Dn varialble value for ghost64 which it works with +1 drive index
set /A Dn+=1
::Call ghost to apply the MSDOS image to the drive cleaned
MSDOSGhost\ghost64.exe -batch -clone,mode=restore,src=MSDOSGhost\dos.gho,dst=%Dn%:1 -sure -quiet -blind -pmbr
If %ERRORLEVEL% NEQ 0 goto Error
::Restore variable initial value
set /A Dn-=1
title Disk %Dn% Completed!
echo Drive has been successfully wiped.
goto Edn
::Error function if Ghost output error level change
:Error
set /A Dn-=1
title Disk %Dn% Error!
echo Something went wrong, please try again!
goto Edn
::It Keeps the console open
:Edn