Skip to content

Instantly share code, notes, and snippets.

@thany
Created November 6, 2019 14:01
Show Gist options
  • Save thany/9e277646b90bdfa1b9006e4c5043681d to your computer and use it in GitHub Desktop.
Save thany/9e277646b90bdfa1b9006e4c5043681d to your computer and use it in GitHub Desktop.
A CMD script that is not cancellable by pressing Ctrl+C
@echo off
setlocal
if "%~1" equ "NonCancelable" goto NonCancelable
start "" /B cmd /C "%~F0" NonCancelable
exit
:NonCancelable
rem DO STUFF HERE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment