Possible Duplicate:
How do I run a batch file from my Java Application?
Yes, I know this question has been asked many times. I have seen the solutions but non of them work for me. Currently I am doing this:
public static void main(String args[])
throws IOException
{
Runtime rt = Runtime.getRuntime();
rt.exec("C:\\sample-win32\\sample.bat");
}
Surprising part is eclipse run smoothly, no error or exception comes. But the file 'sample.bat' does not do what it is supposed to do.Please help.
Say this is my batch file. I am simply making a folder and opening it. When I double click the batch file it works fine. But when I use the java program, nothing happens.
md 1
start 1