Skip to content

Instantly share code, notes, and snippets.

@thany
Last active November 6, 2019 14:02
Show Gist options
  • Save thany/fc2a411d00c5d63930b8c85930d05c65 to your computer and use it in GitHub Desktop.
Save thany/fc2a411d00c5d63930b8c85930d05c65 to your computer and use it in GitHub Desktop.
A CMD script that suppresses the "Terminate batch job" question upon pressing Ctrl+C, and ends the script immediately instead
@echo off
if "%~1"=="-FIXED_CTRL_C" (
shift
) else (
call <nul %0 -FIXED_CTRL_C %*
goto :EOF
)
rem DO STUFF HERE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment