0 Replies Latest reply on Mar 4, 2003 1:43 PM by Loic

    To start batch files

    Loic Newbie


      I want to start a .bat file with several commands in it.
      My problem is i want to know when the end is.

      I try to start it with the line:
      Runtime.getRuntime().exec("cmd.exe \c test.bat" ,tab,new File(MyDirectory)).waitFor();

      But it doesn't wait the end of the batch it stops after the first command line of batch file.

      I try to start it by an exe file. I started the exe file in the class and the exe started the batch file (waiting the end of the file during one minute). My new problem is that the first line of the batch file is executed but not the rest of the commands. The exe file wait the hole minute and left the hand to the java class.

      Does anybody have an idea to start a batch file (with several commands) and waiting the end of it.

      Thanks for helping me.