title: Starting CLI application programmatically does not work depending on arguments
body: <p>I try to start <code>plink.exe</code> (PuTTY Link, the command line utility/version of PuTTY) from a C# application to establish an SSH reverse tunnel, <strong>but it does no longer work as soon as I pass the correct parameters</strong>.</p>
  
  <p>What does that mean? The following works as expected: it opens a command line window, displays that I forgot to pass the password for the <code>-pw</code> argument quits, and shows the prompt. I know it got the arguments, since it specifically requests the one thing I did not provide.</p>
  
  <pre><code>Uri uri = omitted;
  ProcessStartInfo info = new ProcessStartInfo();
  info.FileName = "cmd";
  info.Arguments = "/k \"C:\\Program Files (x86)\\PuTTY\\plink.exe\" -R 3389:" + uri.Host + ":" + uri.Port + " -N -l username -pw"; // TODO pwd
  Process p = Process.Start(info);
  </code></pre>
  
  <p>I tried the same think with calling <code>plink.exe</code> directly instead of <code>cmd.exe /k</code>, but the window closes immediately, which is unfortunate for bug-hunting.</p>
  
  <p>BUT when I pass a password in the arguments, <code>plink.exe</code> displays the program help (showing available parameters) and quits:</p>
  
  <pre><code>Uri uri = omitted;
  ProcessStartInfo info = new ProcessStartInfo();
  info.FileName = "cmd";
  info.Arguments = "/k \"C:\\Program Files (x86)\\PuTTY\\plink.exe\" -R 3389:" + uri.Host + ":" + uri.Port + " -N -l username -pw secretpassword";
  Process p = Process.Start(info);
  </code></pre>
  
  <p>No indication of missing parameters. Both the <code>cmd /k</code> and <code>plink.exe</code> variants do not work (the latter closes immediately, so no information regarding different behaviour).</p>
  
  <p>When I launch the application from the Windows 7 Start Menu launcher with the identical parameters, it opens a <code>cmd.exe</code> window and establishes the connection as requested.</p>
  
  <p>What's wrong? Is there a way <code>plink.exe</code> notices it's not running in a real shell? If yes, how can I circumvent it, like the Start Menu "prompt" does?</p>
  
  <p>I hope this question is right on SO, since it, though specifically for a single application, revolves around launching it successfully programmatically.</p>