How can I suppress the "terminate batch job" in cmd.exe [closed]

I'm looking for a mechanism for suppressing the "Terminate batch job? (Y/N)" invitation that I get whenever I press CTRL-C in a program started from a batch file:

batch file: jsshell.bat:

@echo off
java -jar build-scripts\contrib\rhino1.7R1.jar

and then starting it on cmd shell by:

> jsshell.bat

which gives me a shell that can be exited by CTRL-C but after invoking CTRL-C I get a "Terminate batch job (Y/N)?" message which is nasty and annoying. How can I get it to just exit without me having to press 'y'?


At this site, I finally found an effective solution:

script.cmd < nul

To not have to type this out every time I made a second script called script2.cmd in the same folder with the line above. You may want to reverse the names. Works for me, but tested so far on XP only.


The behaviour is implemented in the cmd.exe source code, and isn't possible to turn off without modifying cmd.exe. However you can modify cmd.exe to not show the message.