title: Help with .ReadToEnd() with Command Prompt
body: <p>Hey,  I am trying to use PowerISO's command line program piso.</p>
  
  <p>I am using C# to open a process and enter the command to mount a cd/dvd.  This is working fine and the cd/dvd gets mounted every time.</p>
  
  <p>The trouble is that .ReadToEnd() will not stop reading and the program hangs here.  It seems as though the response from the command prompt should be</p>
  
  <pre><code>PowerISO Version 4.5 Copyright(C) 2004-2009 PowerISO Computing, Inc Type piso -? for help
  
  Mount successfully
  </code></pre>
  
  <p>However I am only getting to :</p>
  
  <pre><code>PowerISO Version 4.5 Copyright(C) 2004-2009 PowerISO Computing, Inc Type piso -? for help
  </code></pre>
  
  <p>and the program will continue to read forever, never getting the Mount successfully output.</p>
  
  <p>Here is my C# code:</p>
  
  <pre><code>String output = "";
  System.Diagnostics.Process cmd = new System.Diagnostics.Process();
  cmd.StartInfo.WorkingDirectory = @"C:\";               //@"
  
  cmd.StartInfo.FileName = Path.Combine(Environment.SystemDirectory, "cmd.exe");
  cmd.StartInfo.UseShellExecute = false;
  cmd.StartInfo.RedirectStandardInput = true;
  cmd.StartInfo.RedirectStandardOutput = true;
  cmd.StartInfo.RedirectStandardError = false;
  cmd.Start();
  
  cmd.StandardInput.WriteLine(MountPrgLoc + " " + 
                                                  MountPrgCmd_Mount + " " +
                                                  location + " " +
                                                  drive);
  StreamReader sr = cmd.StandardOutput;
  output = sr.ReadToEnd() ;
  MessageBox.Show(output);
  </code></pre>
  
  <p>Thanks in advance for any help
  -Scott</p>
  
  <p>------------------Edit -----------------
  More info:</p>
  
  <pre><code>/* DVD Attributes */
  String name = "My Movie Title";
  String location = "\"" + @"C:\Users\Razor\Videos\iso\Movie.iso" + "\"";
  String drive= "H:";
  String format = ".iso";
  
  /* Special Attributes */
  String PlayPrg = "Windows Media Center";
  String PlayPrgLoc = @"%windir%\ehome\";       //@"
  String MountPrg = "PowerISO";
  String MountPrgLoc = "\"" + @"C:\Program Files (x86)\PowerISO\piso.exe" + "\"";    //@"
  String MountPrgCmd_Mount = "mount";
  String MountPrgCmd_Unmount = "unmount";
  </code></pre>