Hey, I am trying to use PowerISO's command line program piso.
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.
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
PowerISO Version 4.5 Copyright(C) 2004-2009 PowerISO Computing, Inc Type piso -? for help
Mount successfully
However I am only getting to :
PowerISO Version 4.5 Copyright(C) 2004-2009 PowerISO Computing, Inc Type piso -? for help
and the program will continue to read forever, never getting the Mount successfully output.
Here is my C# 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);
Thanks in advance for any help -Scott
------------------Edit ----------------- More info:
/* 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";