Originally posted by Tony Docherty:
The first parameter is a command and a list of arguments the command takes so unfortunately no you can't pass multiple commands in.[/QB]
Not really true. One can use Runtime.exec() to invoke cmd.exe on Windows (or sh on Linux/Unix) and then pass the commands a line at a time though the process stdin stream.
On Linux/Unix, one can also pass the list of commands separated by a semi-colon using a command along the lines of
String[] command =
{
"sh", // Invoke the shell
"-c", // Make the shell execute the following commands
"cd /home/fred; ls; pwd; df -k", // The commands separated by semi-colons
};