File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "console window flash" Watch "console window flash" New topic

console window flash

shilpa reddy

Joined: Dec 12, 2000
Posts: 29
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,
Jim Yingst

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

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?
I agree. Here's the link:
subject: console window flash