Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

console window flash

 
shilpa reddy
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).]
 
shilpa reddy
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic