Try this (or see in API):<br>
String[] cm=new String[2];<br>
cm[0]="C.EXE";<br>
cm[1]="Parms to exe, if needed";<br>
Process p=Runtime.getRuntime().exec(cm);<br>
<br>
if you want to wait the end of the process<br>
try {<br>
p.waitFor();<br>
} catch ...<br>
If you want to execute OS inner commands (like dir, copy, etc.) you must execute the command.com (in Win9x) or cmd.exe (in WinNT).<br>
For example: "command /c dir *.java" or "cmd /c dir *.java".<br>
The /c means that no permanent OS loaded, only one command and exit.<br>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.