title: Running exe file with arguments from java program and sending output to text file
body: <p>I want to run a exe file that accepts a mp3 file as an argument and redirects the output to a text file.</p>
  
  <p>I am using the below command from command prompt and its running fine and making a log.txt file in my binary folder however I am unable to do so by java.</p>
  
  <pre><code>    C:\Users\Desktop\binary&gt;codegen.exe kalimba.mp3 &gt; log.txt
  </code></pre>
  
  <p>I have tried the ProcessBuilder class however cannot see the log.txt made in the binary folder </p>
  
  <pre><code> File f = new File("C:/Users/Desktop/binary");
  ProcessBuilder pb = new ProcessBuilder("cmd", "/c","start","codegen.exe", "kalimba.mp3", "log.txt");
  pb.directory(f);
  </code></pre>
  
  <p>Any idea what I might be doing wrong?</p>