For running programs - use Runtime.exec()
From the
Java api specs:
public Process exec(
String cmd, String[] envp) throws IOException
Executes the specified string command in a separate process with the specified environment.
This method breaks the command string into tokens and creates a new array cmdarray containing the tokens in the order that they were produced by the string tokenizer; it then performs the call exec(cmdarray, envp). The token parsing is done by a StringTokenizer created by the call:
new StringTokenizer(command)
with no further modification of the character categories.
The environment variable settings are specified by envp. If envp is null, the subprocess inherits the environment settings of the current process.
Parameters:
cmd - a specified system command.
envp - array of strings, each element of which has environment variable settings in format name=value.
Returns:
a Process object for managing the subprocess.
Throws:
SecurityException - if a security manager exists and its checkExec method doesn't allow creation of a subprocess.
IOException - if an I/O error occurs
Here's an NT example (thanks to cs sakthi):
[This message has been edited by Tod Tryk (edited June 13, 2001).]