Hi there! I have a program which uses a CMD program to execute various arguements.
The arguements that would work in a normal CMD would be C:\\temp\\bin\\fls.exe -m C: -r C:\\temp\\image.dd > C:\\temp\\bin\\ntfs.bodyfile
The C# program that I have written only works till C:\\temp\\bin\\fls.exe -m C: -r C:\\temp\\image.dd
but does not execute the > C:\\temp\\bin\\ntfs.bodyfile
which means save the process into the ntfs.bodyfile.
I have read many other websites and they all point to the problem of my program missing a streamreader to save the completion of the process into a file. So can someone please advise on my program to allow the process to be saved into a file? Thanks!
One such similar website that has a same problem would be: http://stackoverflow.com/questions/1521725/streamreader-to-file
static void Main(string args)
Process process = new Process();
process.StartInfo.FileName = "C:\\temp\\bin\\fls.exe";
process.StartInfo.Arguments = "-m C: -r C:\\temp\\image.dd > C:\\temp\\bin\\ntfs.bodyfile";
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardInput = true;
process.StartInfo.RedirectStandardError = true;
System.IO.StreamReader reader = process.StandardOutput;
string sRes = reader.ReadToEnd();