File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes console window flash Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "console window flash" Watch "console window flash" New topic
Author

console window flash

shilpa reddy
Greenhorn

Joined: Dec 12, 2000
Posts: 29
Hi,
I am passing certain parameters to the os using Runtime.getRuntime.exec() method.
However the console window flashes briefly while the command gets executed.
How can I prevent this ?
Thanks in advance,
Shilpa
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
What "certain parameters" are you passing? What String or String array are you using as an argument to the exec() method?
[This message has been edited by Jim Yingst (edited April 30, 2001).]


"I'm not back." - Bill Harding, Twister
shilpa reddy
Greenhorn

Joined: Dec 12, 2000
Posts: 29
Hi Jim,
I am trying to retrieve a system property from Windows NT environment. The following is the command passed -
String str = new BufferedReader(new InputStreamReader(Runtime.getRuntime().exec(new String[]{"cmd.exe", "/cset","KEY"}).getInputStream())).readLine();
KEY the environment variable for which I am trying to retrieve the value.
This is successful except the console window seems to flash briefly.
I have tried to set echo off in the same command ,i.e -
Runtime.getRuntime().exec(new String[]{"cmd.exe", "@echo off","/cset","KEY"}. This has not worked.
Any suggestions?
Thanks.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: console window flash
 
Similar Threads
Directing Ant output to Eclipse console
standalone application question
Multiple Consoles in Eclipse
java jdeveloper
visual age use