Launching external console application from JAVA
- by Andrew
Hi
in a java application i need to run an external console application. With the window's ones everything is OK:
try {
System.out.println("Running...");
Runtime.getRuntime().exec("notepad.exe");
System.out.println("End.");
}
catch(Exception e) {
System.out.println(e.getMessage());
}
launches notepad successfully.
But if I put "D:\MyProg.exe" or ".bat" or even "cmd.exe" (which is it PATH as notepad is) it does not work. Without any exeptions. Just:
Running...
End.
Can somebody help? Thanx.