title: Close a program when finished with command line
body: <p>I have a batch file that open an <code>.exe</code> program. The program is <code>fileuploader.exe</code>.</p>
  
  <p>Is there a way to close this program when the upload process finished with the command line?</p>
  
  <p>Because the program generate an output file and i need this output for another command line operation.</p>
  
  <p>I tried this:</p>
  
  <pre><code>start fileuploader.exe filetoupload  
  :loop  
  taskkill /im fileuploader.exe   
  goto loop
  </code></pre>
  
  <p>When the program is working and <code>taskkill</code> send a request to close the program, it shows this message:</p>
  
  <blockquote>
    <p>An upload is in progress do you want to exit?</p>
  </blockquote>
  
  <p>the loop do this until the upload is finished and <code>taskkill</code> close Fileuploader. But I don't like this solution.</p>
  
  <p>There's a way to execute the <code>taskkill</code> after a certain time? Like every 2 minutes for example?</p>