title: How to start a console application and prevent it from closing at the end?
body: <p>I'm starting a shell script (.cmd) from my .NET application. I'd like the console window to remain open after the script has completed so that I can check for any errors. I'm trying with <code>cmd.exe /K:my.cmd</code>, but for some reason that does not work (the script does not get executed). Even a simple "dir" command does not work. Any other ideas?</p>
  
  <p>To demonstrate, this:</p>
  
  <pre><code>System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo()
  {
      Arguments = "/K:dir",
      ErrorDialog = true,
      FileName = "cmd.exe",
      WorkingDirectory = @"C:\"
  });
  </code></pre>
  
  <p>Gives me this:</p>
  
  <pre><code>C:\&gt;
  </code></pre>
  
  <p><strong>Added clarification:</strong> My application (the one that starts the script) is a <strong>windows forms</strong> application. Executing the above code opens a new console window (as it should). I want THAT new console window to remain open. Also, I cannot modify the script. It's an automated build script and it HAS to terminate.</p>