title: Not able to send commands to cmd.exe process
body: <p>I am trying to send commands to an open cmd.exe process using <code>StandardInput.WriteLine(str)</code>, however none of the commands seem to be sent. First I open a process, with a global variable p (<code>Process p</code>).</p>
  
  <pre><code>p = new Process()
  {
      StartInfo = {
          CreateNoWindow = true,
          UseShellExecute = false,
          RedirectStandardError = true,
          RedirectStandardInput = true,
          RedirectStandardOutput = true,
          FileName = @"cmd.exe",
          Arguments = "/C" //blank arguments
      }
  };
  
  p.Start();
  p.WaitForExit();
  </code></pre>
  
  <p>After, I try to send a command using a simple method, that logs the result in a text box.</p>
  
  <pre><code>private void runcmd(string command)
  {
      p.StandardInput.WriteLine(command);
      var output = p.StandardOutput.ReadToEnd();
      TextBox1.Text = output;
  }
  </code></pre>
  
  <p>Right now I am testing it with <code>DIR</code>, but <code>var output</code> shows up as null, which results in no output. Is there a better way to send a command to the open cmd.exe process?</p>