chamilad
chamilad

Reputation: 1669

Monitor output of a command prompt in C#

Is there a way to monitor the output of a command prompt without redirecting its output to a stream reader so that it can be detected if error messages display in it? I'm using C#.

Upvotes: 1

Views: 603

Answers (2)

Tadeusz
Tadeusz

Reputation: 6913

You must use AttachConsole for cmd.exe process.

Upvotes: 1

Oliver
Oliver

Reputation: 45109

Simple answer: No.

If you need the console output of a program you have to redirect its output stream.

Upvotes: 1

Related Questions