title: C# execute, wait, read command's output
body: <p>I'm trying to read all system information on a windows pc, using C#. Here is my code :</p>
  
  <pre><code> public static string GetSystemInfo()
          {
              String command = "systeminfo";
              ProcessStartInfo cmdsi = new ProcessStartInfo("cmd.exe");
              cmdsi.Arguments = command;
              Process cmd = Process.Start(cmdsi);
              cmd.WaitForExit();
              return cmd.StandardOutput.ReadToEnd();
          }
  </code></pre>
  
  <p>But it just opens a console, doesn't execute <code>systeminfo</code> command.</p>
  
  <p><strong>How this can be solved?</strong></p>