470,833 Members | 1,858 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,833 developers. It's quick & easy.

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

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
2 2786
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
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.

Similar topics

13 posts views Thread by BlackHawke | last post: by
6 posts views Thread by somebody | last post: by
2 posts views Thread by uwnewsgroup | last post: by
5 posts views Thread by Good Man | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.