Run exe file from java program
The code shows how to call external program from java code.
To run example include the code below in the runexe.java file, compile and
execute it.
class runexe
{
public static void main(String[] args)
{
Runtime r =Runtime.getRuntime();
Process p =null;
String cmd[]={"notepad","f:/mytext.txt"};
try{
p=r.exec(cmd);
}
catch(java.lang.Exception e)
{}
}
}
|