title: Running a bat file in background
body: <p>I've this .bat file which I'd like to run in the background. The file basically launches processes. The output of the .bat file would be:</p>
  
  <pre><code>X:\bin&gt;start_STAF.bat
  start_STAF.bat
  
  X:\bin&gt;X:\ActiveState\Perl\perl-5.14.0\bin\perl.exe x:\bin\start_STAF.pl
  
  The operation completed successfully.
  The operation completed successfully.
  The operation completed successfully.
  *
  STAFProc is now Started.  Leave this window up.
  *
  </code></pre>
  
  <p>Pressing the Enter key after a few minutes returns the control back to the prompt. I don't like this because this process needs to be launched through a Perl script and I don't know how one would automate the Enter key press through Perl.</p>
  
  <p>There's a few things that I've tried, unsuccessfully.</p>
  
  <p>I tried using <code>START /B start_STAF.bat</code> but what this does is that it returns back to the prompt without launching the .bat file. However, the next time I execute <code>tasklist</code>, the .bat file launches on stdout. This brings me back to square one.</p>
  
  <p>I tried redirecting the stdout/stderr as <code>start_STAF.bat &gt;nul 2&gt;&amp;1</code> but this too, does not launch the .bat file.</p>
  
  <p>Is there anything else that I can do? Thanks!</p>