title: Using cmd.exe from C#
body: <p>I have been toying with the Process class in C#. I have some code below I'd like to use to open cmd.exe and run the DIR command. However, when I attempt to use the code, the cmd.exe opens, but no command is run. Why is this happening and how do I fix it?</p>
  
  <pre><code>Process cmd = new Process();
  cmd.StartInfo.FileName = @"cmd.exe";
  cmd.StartInfo.Arguments = @"DIR";
  cmd.Start();
  cmd.WaitForExit();
  </code></pre>