You want to ask Google about
Runtime[
^]. Here is some code I use to do that kind of thing:
protected Process DoSysCommand(String sCmd, boolean bWait)
{
Runtime r = Runtime.getRuntime();
Process retP = null;
try
{
retP = r.exec(sCmd);
if(bWait)
{
retP.waitFor();
}
}
catch(IOException e)
{
System.err.println(e.getMessage());
}
catch(InterruptedException e)
{
System.err.println(e.getMessage());
}
return retP;
}