Use the Process class found in the System.Diagnostic namespace.
Process proc = new Process();
// test.exe is a console application generated by VC6
proc.StartInfo.FileName = @'C:\test\test.exe';
proc.StartInfo.Arguments = '';
proc.StartInfo.CreateNoWindow = true;
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.RedirectStandardOutput = true;
proc.Start();
string output = proc.StandardOutput.ReadToEnd();
//output now holds what text.exe would have displayed to the console
Share with