srikandula
Programmer
I have created a program to run the batch file.The problem is when the batch file has commands like "dir" etc its working fine.But when i have command like "cd.." its not running properly.
Say I use
c:\jdk1.3\bin\javaexamples\java batchRunner.class
where batchRunner.class is a class to run the batch file and the batch file i am calling has "cd..".By the end of the program the control should be at "....\bin\" directory as per my requirement.But while the program runs, it is going to ..\bin\ directory and as soon the as the program is complete the prompt is at "..\javaexamples\" ie no change of "cd.." is visible.
The code i am using to call the batch file is
Runtime.getRuntime().exec("mybatch.bat"
Note:-There are no compile or runtime errors , but the control is not moving one level up.If i individually run the batch file its is working well and fine.ie moving one level up.
Can any one help me in this problem.
Thanks in advance.
Say I use
c:\jdk1.3\bin\javaexamples\java batchRunner.class
where batchRunner.class is a class to run the batch file and the batch file i am calling has "cd..".By the end of the program the control should be at "....\bin\" directory as per my requirement.But while the program runs, it is going to ..\bin\ directory and as soon the as the program is complete the prompt is at "..\javaexamples\" ie no change of "cd.." is visible.
The code i am using to call the batch file is
Runtime.getRuntime().exec("mybatch.bat"
Note:-There are no compile or runtime errors , but the control is not moving one level up.If i individually run the batch file its is working well and fine.ie moving one level up.
Can any one help me in this problem.
Thanks in advance.