Redirecting output in a shell (VB5) 
Author Message
 Redirecting output in a shell (VB5)


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

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?


Sun, 18 Mar 2001 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Redirected Output From DOS Shell In Visual Basic 6

2. shell with dos tool output redirected to a file

3. Please help: redirecting output of shell started program

4. Probs with redirecting output of a shell started DOS-App to a file

5. redirect output of program run with shell command

6. Redirecting output from a SHELLed DOS Box

7. Redirecting output with Shell

8. using shell to exec dos app and redirect it's output

9. VB4, WIN95: Redirecting output of a shelled process

10. Shell redirect to standard output not working

11. VB4 - problem creating text from redirected output of shell command

12. Redirecting Print Output


Powered by phpBB® Forum Software