title: Open Notepad with C# application in Windows Command Prompt
body: <p>I wrote this program to open Notepad with C# application in Windows Command Prompt but it can´t</p>
  
  <p>What is the problem?</p>
  
  <pre><code>namespace msdos
  {
  public partial class Form1 : Form
  {
      public Form1()
      {
          InitializeComponent();
  
          Process p = new Process();
          ProcessStartInfo info = new ProcessStartInfo();
          info.FileName = "cmd.exe";
          info.RedirectStandardInput = true;
          info.UseShellExecute = false;
  
          p.StartInfo = info;
          p.Start();
  
          p.WaitForExit();
  
          using (StreamWriter sw = p.StandardInput)
              if (sw.BaseStream.CanWrite) { sw.WriteLine("notepad.exe"); }
      }
  }
  }
  </code></pre>