1 Reply Latest reply on Nov 25, 2007 12:14 PM by 796254

    Invoking a batch file from a java Program(I have problems wid runtime.exec)

      I need to invoke a batch file fom my java program, the batch file in turn invokes an encryption tool to ecnrypt files (using its command line command). The encryption process takes some 20 seconds to complete and my java program doesnt wait for it to complete*.
      The encryption is not done fully and the files get corrupted. The following is the piece of code is used

      proc = rt.exec("cmd.exe /c "+batfileloc+"downtempbat.bat");

      I gave sleep after it, but sleep does not have any effect, by the time the execution reaches sleep, the processs is killed already.

      Please help me in this, its been giving me a lot of problem