title: Start command windows and run commands inside
body: <p>I need to start the command window with some arguments and run more commands inside.</p>
  
  <p>For example, launch a test.cmd and run mkdir.</p>
  
  <p>I can launch the test.cmd with processstartinfo , but i am not sure how to run further commands. Can I pass further arguments to the test.cmd process?</p>
  
  <p>How do I go about this?</p>
  
  <p>Unable to add comments to answer... SO writing here.</p>
  
  <p>Andrea, This is what I was looking for. However the above code doesnt work for me. </p>
  
  <p>I am launching a test.cmd which is new command environment (like razzle build environment) and I need to run further commands.</p>
  
  <pre><code>psi.FileName = @"c:\test.cmd";
  psi.Arguments = @"arg0 arg1 arg2";
  
  psi.RedirectStandardInput = true;
  psi.RedirectStandardOutput = true;
  psi.CreateNoWindow = true;
  psi.UseShellExecute = false;
  
  Process p = new Process();
  p.StartInfo = psi;
  p.Start();
  p.StandardInput.WriteLine(@"dir&gt;c:\results.txt");
  p.StandardInput.WriteLine(@"dir&gt;c:\results2.txt"); 
  </code></pre>