14 Replies Latest reply: Jul 31, 2007 5:07 AM by 807605 RSS

    Executing bat files from another location

    807605
      Hi
      In my application i need to execute a bat file which is in another location.
      i have my class file in c:\ds and i want to execute the bat file in c:\ds\src\jython.

      This is the code i have used

      private void executeBootstrapBat(){
      String cmd=null;
      cmd="cmd /c bootstrap C:\\DS\\HelperApplication\\src\\conf\\wsadmin-local.properties" +
      " " + getXmlFileName() + " " + getVOB();
      Runtime rt = Runtime.getRuntime();
      try{
      Process pt = rt.exec(cmd);
      }catch(IOException e){
      e.printStackTrace();
      }
      }