title: Run .exe file from code behind asynchronously
body: <p>I have a console application that writes on a txt files information retrieved from a database. Until now I manually executes the executable generated by the console application.</p>
  
  <p>Now I need to automatize the invocation of the .exe from my web application, so that each time a specific condition happens in my code behind I can run the .exe with a logic "fire and forget".</p>
  
  <p>My goals are:</p>
  
  <p>1) Users must not be affected in any way by the console application execution (the SQL queries and txt file generation might take around 3 to 5 minutes), therefore the logic of "fire and forget" delegated to a separate process.</p>
  
  <p>2) Since the executable will be still run manually in some cases, I would prefer having the all logic in one place, in order to avoid the risk of having a different behaviour.</p>
  
  <p>Can I safely use <strong>System.Diagnostics.Process</strong> to achieve this?</p>
  
  <pre><code>System.Diagnostics.Process cmd = new System.Diagnostics.Process();
  cmd.Start("Logger.exe");
  </code></pre>
  
  <p>Does the process automatically ends or do I have to set a timeout and explicitly close it? <br/>Is it "safe" in a web application environment with different users accessing the web application let them call the executable without the risk of concurring accesses?
  Thanks.</p>
  
  <p>EDIT:
  Changed to use the built in class for more clarity, thanks for the hint.</p>