import java.io.*;
package exeCall;
public class call{
Process child = null;
String errMsg = "";
public call(){
}
public void callProcess(String command){
try{
//String command = "C:\\Program\\NoteXPad\\NoteXPad.exe"; child = Runtime.getRuntime().exec(command);
}catch(IOException ioe){
//System.out.println("IOException: "+ioe.getMessage()); errMsg = errMsg + "IOException: "+ioe.getMessage();
}catch(Exception e){
//System.out.println("Exception: "+e.getMessage());
errMsg = errMsg + "Exception: "+e.getMessage();
}
}
public String getErrorMsg(){
return errMsg;
}
public static void main(String[] args){
String commandStr = "D:\\program\\TheWorld\\TheWorld.exe"; call c = new call();
c.callProcess(commandStr);
if(!(c.getErrorMsg()).equals("")){
System.out.println("Error catched while calling \""+commandStr+"\"");
System.out.println("details are as follows:");
System.out.println(c.getErrorMsg());
}