Skip to content

Instantly share code, notes, and snippets.

@brianfgonzalez
Last active November 27, 2019 22:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianfgonzalez/dcedc971176ba87551b10ef9f40c332e to your computer and use it in GitHub Desktop.
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.
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