
Redirecting output in a shell (VB5)
Hi!
I have a case where I need to re-direct the console output of a program
that I run in a shell from VisualBasic. I'm using the CreateProcess API
command to run the program.
The first thing I tried was to include the ">" (redirect) operator in the
command line. Apparently, that doesn't work because it is a function of
the command shell, which isn't running when CreateProcess is called. One
possible solution would be to run my command within COMMAND.COM to get the
use of the redirect operator.
Before I do that, though, I wanted to ask: What's the best way to do
this???
Related to this, what is the best way to wait until a called program has
completed? Right now, I have a loop that has a handle to the process which
it uses to poll the process for its status until it is complete. Is there
a better way to do this?
Thanks!
Ken