In my C# code, I have to run some external processes. These could be batch files or executables. I redirect the output to a window of my own by having RedirectStandardOutput
of the ProcessStartInfo
be true. This allows the user to review the output even after the external process has finished. I also redirect the input so the user can press keys if necessary. This works very well in general.
However, I have one problem. Some of the batch files use the PAUSE
command. Apparently the output isn't flushed by the command until a key has been pressed. Thus, the user never sees the prompt. So only after a key has been pressed will the user see that he should have pressed a key to continue. Is there a way to make this work (besides "Don't use PAUSE")?
EDIT: The batch files run the user's CAM post-processor and are usually created by the user (or the user's IT department). So requiring changes to these files or "hacking" by creating a pause.exe aren't really viable solutions (unless as very last resort).