misc/quit.batch
@Echo off:start_scriptIF NOT EXIST c:\temp\%~n0.bat goto :clone_meIF EXIST c:\temp\%~n0.bat goto :exit_me :clone_me@Echo Cloning script ...IF EXIST c:\temp\ goto :copy_scriptIF NOT EXIST c:\temp\ goto :create_temp:create_temp@Echo Creating directory : C:\tempmkdir c:\temp > nulgoto :copy_script:copy_script@Echo copying %~f0 -> c:\temp\%~n0.batcopy "%~f0" "c:\temp\%~n0.bat"goto :call_clone:call_clone@Echo Starting cloned scriptcall "c:\temp\%~n0.bat"goto :done:exit_me@Echo Closing down environmentpushd hmh\miscdel quit.batpopdpushd c:\tempsubst w: /Dpopdfor /f "skip=1 delims=" %%x in ('wmic cpu get addresswidth') do if not defined AddressWidth set AddressWidth=%%xif %AddressWidth%==64 ( @Echo Cleaning Visual Studio environment for 64 bit OS call "E:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" -clean_env) else ( @Echo Cleaning Visual Studio environment for 32 bit OS call "E:\Program Files\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" -clean_env)@Echo Deleting clone and exiting ...del "%~f0"&exitgoto :done:errorREM We should add a link hereecho [ERROR:~nx0] Error in script usage.pausegoto :start_script:done@Echo We should NEVER reach this!!pushdexit /B