Hi Anand,
There is a way to redirect the output of a console window you start from an application, by using the ProcessStartInfo class with your Process object. You can find the full details on MSDN:
http://msdn2.microsoft.com/en-us/lib...ardoutput.aspx
A simple example:
Code:
// create the process
Process myproc = new Process();
// set file and arguments
myproc.StartInfo.FileName = "myconsole.exe";
myproc.StartInfo.Arguments = "someargument";
// this must be false to let us get output
myproc.StartInfo.UseShellExecute = false;
// tell it to redirect
myproc.StartInfo.RedirectStandardOutput = true;
// start process up
myproc.Start();
// get the output
string output = myprocess.StandardOutput.ReadToEnd();
// let process finish
myproc.WaitForExit();
/* output is now a string, so you can save to a file */
If you're not careful, you can get confusing problems with the 2 programs deadlocking each other, e.g. both waiting for input, but the MSDN page is fairly good at explaining it.
Hope this helps
Phil