
Redirecting output from a SHELLed DOS Box
Hello Steve,
I don't know if this will work, but you might try running the command
processor as well as the program. I don't think redirection will work with
a program running without a shell. Try:
Shell "command /c build >compiler.out", vbNormalFocus
for Windows 95 and:
Shell "cmd /c build >compiler.out", vbNormalFocus
for Windows NT. For Windows 3.1, creating a PIF file for the application
and shelling it instead. But I assume that you're running either 95 or NT.
If it still doesn't work, it might be because the program that you're
running does support redirection. In other words, it may not write to
STDOUT, it might write directly to the console or to STDERR (redirect
STDERR with a 2>, I think). Can you redirect from the command line without
a problem? If so, than changing the shell statement as I've suggested
should fix your problem. If you can't redirect manually, then most likely
you're going to have a hard time. The app just isn't made to support
redirection.
I hope this helps,
Larry Tubbs, MCPS, MCSD
Silverleaf Vacation Club
http://www.flash.net/~enigma/
Quote:
> I can't persuade a batch file that runs a 'C' compiler MAKE session to
> accept output redirection.
> I'm using the command:-
> Shell "build >compiler.out", vbNormalFocus
> The process works fine but the output isn't redirected. I need to
> capture it to blast into my editor for review.
> In fact now I try it, I have trouble getting W95 to redirect the
> output of all batch files.
> Any ideas?
> --
> Steve
> Steve