wood burning stoves 2.0*
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


Win a copy of Spring in Action this week in the Spring forum!
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: console window flash