It may not be exactly what you want, but, in my opinion, it leads you on the right path.
p.StartInfo.UseShellExecute = false; p.StartInfo.RedirectStandardOutput = true; p.OutputDataReceived += p_OutputDataReceived; p.Start(); p.BeginOutputReadLine();
Then your event handler to retrieve the data.
void p_OutputDataReceived(object sender, DataReceivedEventArgs e) { Debug.Write(e.Data); }
source share