As Raffzahn says, you can’t redirect standard error under DOS, at least not with the standard COMMAND.COM
. With 4DOS, both output streams can be redirected with >&
. That would allow you to redirect to a file as well as a device.
Instead of trying to redirect the input and output streams to use a serial connection, under DOS you’d change the TTY:
ctty com1
This will work with any character device (with varying results if the character device isn’t appropriate).
Note that many DOS programs don’t use the standard input and output streams, but read from the keyboard and write to the screen without using DOS services; such programs won’t honour redirection or CTTY
and won’t work over a serial connection.
(Amusingly enough, DOS has five standard device handles: standard input, standard output, standard error, standard auxiliary and standard list. The first three are attached to CON
by default; the fourth to AUX
, and the fifth to PRN
.)