View Single Post
  #2 (permalink)  
Old 06-25-2007, 10:33 PM
pgandle pgandle is offline
Member
 
Join Date: Jun 2007
Posts: 1
pgandle is on a distinguished road
solution from java world
CreateProcess error=2, trying to open xml file
When Runtime.exec() won't - Java World

try {
String[] cmd = new String[4];
cmd[0] = "cmd.exe";
cmd[1] = "/C";
cmd[2] = "start";
cmd[3] = "D:\\examples\\invoices\\2-1-20070625061706-ABC.xls";
// cmd[3] = "will.xls";
// cmd[3] = "mailto:";
// cmd[3] = "a.html";
// cmd[3] = "file:/c:/java/temp/a.html";

Process process = Runtime.getRuntime().exec( cmd );
} catch (IOException e) {
e.printStackTrace();
}
Reply With Quote