Tired of “Terminate batch job (Y/N)?”, try this
Posted by Venkatt Guhesan on June 24, 2011
When you invoke a batch file or most applications in a command-prompt and when you wish to close the application by doing a CTRL+C, you get the annoying “Terminate batch job (Y/N)?” prompt. And in most cases, even if you type a “n”, it still kills the application. Example is the Tomcat startup. To avoid this, try this:
YourScript.cmd < Nul
This should no longer ask you with the annoying prompt “Terminate batch job (Y/N)?”.
Now for a few examples from my everyday usage:
grails run-app < Nul h2.bat < Nul startup.bat < Nul mvn tomcat:run < Nul mvn jetty:run < Nul
Cheers.

User said
I use a this trick to solve it. ;)
::———————————————————
@ECHO OFF
IF “%~1″==”-FIX_CTRL_C” (
SHIFT
) ELSE (
CALL <NUL %0 -FIX_CTRL_C %*
GOTO :EOF
)
::———————————————————
How To Supress “Terminate Batch Job (Y/N)” Confirmation? | Click & Find Answer ! said
[…] this site, I finally found an effective […]