Last active
November 27, 2019 22:19
-
-
Save brianfgonzalez/dcedc971176ba87551b10ef9f40c332e to your computer and use it in GitHub Desktop.
batch script used to prompt user for cleaning of disk and if yes is specified the disk 0 will be cleaned using diskpart.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo return = msgbox("Do you want to wipe the drive?", 4, "This is my title") > %temp%\msgbox.vbs | |
echo if return = 6 then >> %temp%\msgbox.vbs | |
echo wscript.quit(66) >> %temp%\msgbox.vbs | |
echo end if >> %temp%\msgbox.vbs | |
wscript %temp%\msgbox.vbs | |
if %errorlevel%==66 ( | |
echo select disk 0 > %temp%\diskpart.txt | |
echo clean >> %temp%\diskpart.txt | |
diskpart.exe /s %temp%\diskpart.txt | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment