title: C# command prompt output
body: <p>I need to use a command prompt in my project. Everything is ok, but the output is not what I want. If I do this:</p>
  
  <pre><code>        ProcessStartInfo info = new ProcessStartInfo("cmd","/c dir c:\\test");
          info.RedirectStandardOutput = true;
          info.RedirectStandardInput = true;
          info.CreateNoWindow = true;
          info.UseShellExecute = false;
          Process p = new Process();
          p.StartInfo = info;
          p.Start();
          string iii = p.StandardOutput.ReadToEnd();
          textBox1.Text = iii;
  </code></pre>
  
  <p>The result is ok. Exactly as I want. But I also need to send some more commands. So I am doing this:</p>
  
  <pre><code>        ProcessStartInfo info = new ProcessStartInfo("cmd");
          info.RedirectStandardOutput = true;
          info.RedirectStandardInput = true;
          info.CreateNoWindow = true;
          info.UseShellExecute = false;
          Process p = new Process();
          p.StartInfo = info;
          p.Start();
          StreamWriter write = p.StandardInput;
          write.WriteLine("dir c:\\test");
          write.Close();
          string iii = p.StandardOutput.ReadToEnd();
          textBox1.Text = iii;
  </code></pre>
  
  <p>But the result is not like before. It's giving the path and everything in cmd, which I don't want. I need only the result from the command prompt and nothing else. Hope someone can help.  Thanks for reading my problem.</p>