//by this code i want the batch file which is going to be executed will show the output on shell screen which i got by RedirectStandardOutput = false;
but i also want at that same time output should be redirected to a log file for this i have to do this as RedirectStandardOutput = true;
but once one can be used either true or false please help me great programers ... !!
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = "c:\test\build.bat";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.Start();
string output = null;
// try
// {
output = p.StandardOutput.ReadToEnd();
// }
// catch (Exception ex)
// {
// MessageBox.Show(ex.ToString());
// }
System.IO.File.WriteAllText("c:\test\log.txt", output);