Hi,
I m running my
java application from a command window. I want my java application to open another command window and run the specified batch file in that window. My java code is as follows, its not working
public class MyTestClass
{
public static void main(
String args[])
{
System.out.println("Trying to get the Runtime");
Runtime rt = Runtime.getRuntime();
System.out.println("Got the Runtime" + rt);
try
{
rt.exec("C:/WINNT/system32/cmd.exe /C start C:/MyBatchfile.bat");
}
catch(Exception e)
{
e.printStackTrace();
}
}
}
Pls... help me in solving the above problem.
Thanks,
Sankar Ravula