473,396 Members | 1,963 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 2933
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: JW | last post by:
Hi, I don't seem to get any results from the following use of Runtime.getRuntime().exec(cmd) using Java 1.4 on Redhat linux. Suppose that in the same directory as my java file below, I have...
13
by: BlackHawke | last post by:
Our program, game program Andromeda Online (www.andromedaonline.net) uses two programs- one to play the game, another to patch the game as updates come out. Players actually launch the updater...
6
by: somebody | last post by:
I'm trying to change a users password on a Linux system by spawning a process. Here's what the command looks like on the command line: echo 'myuser:mypasswd' | chpasswd It uses a pipe, which...
2
by: uwnewsgroup | last post by:
When I was using Runtime.exec(String cmd) to run a unix utility (join), and try to get its standard output by using Process.getOutputStream(), it blocks forever. I tried it using Java 1.4 and...
5
by: Good Man | last post by:
Hi there I am trying to execute a custom-built java program on my linux server via PHP. Basically, a user uploads files via PHP, and then the java program performs some action on these files. ...
5
by: piradie | last post by:
Hello, I've been googling around, and looking into different webpages but couldn't find a clear response for the issue I need to resolve, so I was hoping any of you could give me an answer to my...
7
by: swethak | last post by:
Hi, i have a command to convert the video file into image ffmpeg -i sample.wmv -f image2 -t 0.001 -ss 3 ss.jpg i run that one in command prompt it converted the video file into...
5
by: sayeo87 | last post by:
Hi, I am quite new to JSP so please forgive me if I ask really simple things... I am trying to run system commands on the server and display the output on a webpage. This is what I've got: <%@...
3
by: Shayco | last post by:
hey, in my code i'm using Runtime.getRuntime().exec() in order to run a .bat file that calls another java program (they communicate with each other using RMI). when i call: Process process =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.