Redirecting Console program Output

Drache

Active member
Joined
Apr 8, 2006
Messages
26
Programming Experience
Beginner
Let me try and explain my problem.

I am trying to write a front-end for several console programs to make them slightly easier to use.
I am using the standard code to launch the console program and redirect the output to my front-end, the problem is that when the console program starts the front-end just freezes until the console program closes, so it doesn’t collect any output from it.

I have tried having the front-end at a higher process priority level and setting the console program to run at below normal, but that didn’t work.

Next it tried starting the process from a different thread using the following code, but no luck there.
VB.NET:
        T = New Threading.Thread(AddressOf SubConsole)
        T.Priority = Threading.ThreadPriority.BelowNormal
        T.Start()
I even tried getting the console program to output to a text file, then read that – But as the console program treats everything after the program name as arguments all I get is a blank test file.

I’m scratching around in the dark here.
 
Thank you for taking the time to reply to my post, unfortunately I had already tried the suggested post on the vb forums.

The suggested code did work on some of the console programs, but not on some others.

Thanks again.
 
Back
Top