File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Runtime.exec() - command line window problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Runtime.exec() - command line window problem" Watch "Runtime.exec() - command line window problem" New topic

Runtime.exec() - command line window problem

Manikandan Krishnan

Joined: Feb 03, 2003
Posts: 2
Everytime Runtime.exec() runs, a new command line window is appearing in the screen. Acually i am executing dos comment through Runtime.exec() method. I am running JDK 1.3 on W2K. How to eliminate command line window from the screen?
I am invoking my application thro' exe file. By click on the exe file my application will run.
Please find the sample code which i have implemented.
String shareDir = "c:\Mani";
Runtime rt = Runtime.getRuntime();
try {
process = rt.exec("net share mani="+shareDir);
catch (Exception x) {
System.out.println ("Exception " + x);
Marilyn de Queiroz

Joined: Jul 22, 2000
Posts: 9059
Moving to Java in General(beginner)

"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
I agree. Here's the link:
subject: Runtime.exec() - command line window problem
It's not a secret anymore!