VOGONS


First post, by Kahenraz

User metadata
Rank l33t
Rank
l33t

I have a bat file that has a large text output when it runs a program. If I run that program directly, I can redirect the output to a file with '>' or pipe it to MORE. However, I can't redirect or pipe the output when executing the bat file.

file.bat > a.log
file.bat | more

Neither of these work. Is it possible to make this work as expected?

Reply 1 of 2, by Jo22

User metadata
Rank l33t++
Rank
l33t++

Hi there! You can try using COPY CON to redirect the i/o of the DOS command line (CONsole).
Another idea is using CTTY command. It can be used to run a DOS PC via serial terminal.
Maybe it works with a file instead, as well, not sure. COM, AUX, PRN, CON etc. are special files, essentially.

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 2 of 2, by Disruptor

User metadata
Rank Oldbie
Rank
Oldbie

DOS: command /c file.bat > a.log
WinNT: cmd /c file.bat > a.log