MyThinkPond

On Java, Python, Groovy, Grails, Spring, Node.js, Linux, Arduino, ARM, Embedded Devices & Web

Archive for the ‘Scripting’ Category

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.

Posted in General, Scripting | Tagged: , , , | 2 Comments »

 
Follow

Get every new post delivered to your Inbox.

Join 160 other followers