title: how to wait for batch command to complete its excecution in java
body: <p>I want to wait till my batch command completes its execution and creates a csv file as out put.the code is as bellow for excecuting batch file</p>
  
  <pre><code>String command = "cmd /c start " + batFile;
          Runtime rt = Runtime.getRuntime();
          Process pr = rt.exec(command);
  </code></pre>
  
  <p>Then i want to use the CSV file(app.csv) to read contents of it. But when i run the program i am getting like.</p>
  
  <pre><code>java.io.FileNotFoundException: C:\appanalysis\app.csv (The system cannot find the file specified)
      at java.io.FileInputStream.open(Native Method)
      at java.io.FileInputStream.&lt;init&gt;(FileInputStream.java:120)
      at java.io.FileInputStream.&lt;init&gt;(FileInputStream.java:79)
      at java.io.FileReader.&lt;init&gt;(FileReader.java:41)
  </code></pre>
  
  <p>How to resolve this</p>