title: How to Execute complex batch command on the fly
body: <p>I am looking for a way to run DOS/windows batch directly from C# code without saving it as .BAT file before. I'm mainly interested to run DOS command with a combination of stdin stream.</p>
  
  <p>Let's say I need execute something like that:</p>
  
  <pre><code>echo 'abcd' | programXXX.exe -arg1 --getArgsFromStdIn
  </code></pre>
  
  <p>After that <strong>programXXX.exe</strong> will take 'abcd' string as -arg1</p>
  
  <p>What I'm doing now is just create bat file in TMP directory and running it, deleting after execution.<br>
  What I need is run it "on the fly" just from .NET code without saving to file previously.<br>
  (Main reason is security, but also do not want to leave rubbish when program crashes etc)</p>
  
  <p>Do you know how to achieve that?</p>