MSDN states that it is possible in .NET to capture the output of a process and display it in the console window at the same time.
Normally when you set StartInfo.RedirectStandardOutput = true; the console window stays blank. As the MSDN site doesn't provide a sample for this I was wondering if anyone would have a sample or could point me to a sample?
When a Process writes text to its standard stream, that text is normally displayed on the console. By redirecting the StandardOutput stream, you can manipulate or suppress the output of a process. For example, you can filter the text, format it differently, or write the output to both the console and a designated log file. MSDN
This post is similar to Capture standard output and still display it in the console window by the way. But that post didn't end up with a working sample.
Thanks a lot,
Patrick
you can easily catch all messages using
and create the Event build_ErrorDataReceived
I add a little example
See this answer here on SO which I posted code for a process to exec netstat an redirect the output stream to a Stringbuilder instance. The process creates a hidden window and is not visible...
You can modify the code slightly by changing the values respectively