By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,087 Members | 1,513 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,087 IT Pros & Developers. It's quick & easy.

Actually showing the command window after Runtime.exec in Java 1,4+

P: n/a
I have a situation where I actually _do_ want the command window to
show after a runtime.exec() call. (Although we pipe stout/stdin to
our own logging mech, the program needs to be able to trap Ctrl-C
keystrokes). Our application is launched by javaw.

In Java 1.3.1, this behaviour was present (and much resented it looks
like) but in 1.4+ Sun have 'fixed' it, and the dos window no longer
pops up on a Runtime.exec("ourbatchfilelauncher.bat") I tried doing
an exec("cmd launcher.bat") but no joy there either.

Is there any way of turning this behaviour back on? Thanks in
advance,

James.
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
James Goldwater wrote:
I have a situation where I actually _do_ want the command window to
show after a runtime.exec() call. (Although we pipe stout/stdin to
our own logging mech, the program needs to be able to trap Ctrl-C
keystrokes). Our application is launched by javaw.

In Java 1.3.1, this behaviour was present (and much resented it looks
like) but in 1.4+ Sun have 'fixed' it, and the dos window no longer
pops up on a Runtime.exec("ourbatchfilelauncher.bat") I tried doing
an exec("cmd launcher.bat") but no joy there either.

Is there any way of turning this behaviour back on? Thanks in
advance,

James,

I wouldn't look for a solution to turn the behavior back on in Java.
That will likely be fruitless.

I would explore using different options to cmd (like /c) and also
explore using the start command (go to Windows help for details). You
might need to have multiple BAT files calling each with the start
command, etc.

Let me know how it works out.

HTH,
Ray

--
XML is the programmer's duct tape.
Jul 17 '05 #2

P: n/a
You could try with the '/c' option, this has worked very well for
me....
You could also read this
(http://www.javaworld.com/javaworld/j...29-traps.html). It
will give you some details about Runtime Execution in Java.....

Quiks.
--------------
BTW: For those who have to do with monitoring, check the site:
http://www.metamindsolutions.com. It's a great multiplatform
monitoring solution and seems to have been adopted by large accounts
ja***@eccehomo.co.uk (James Goldwater) wrote in message news:<3e**************************@posting.google. com>...
I have a situation where I actually _do_ want the command window to
show after a runtime.exec() call. (Although we pipe stout/stdin to
our own logging mech, the program needs to be able to trap Ctrl-C
keystrokes). Our application is launched by javaw.

In Java 1.3.1, this behaviour was present (and much resented it looks
like) but in 1.4+ Sun have 'fixed' it, and the dos window no longer
pops up on a Runtime.exec("ourbatchfilelauncher.bat") I tried doing
an exec("cmd launcher.bat") but no joy there either.

Is there any way of turning this behaviour back on? Thanks in
advance,

James.

Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.