The default MS-DOS shell, COMMAND.COM, does not provide any way to redirect standard error. Doing this requires a different shell, or an external utility. (This problem is sufficiently well known that some command-line programs provide dedicated options to write error messages into a file. NASM, for example offers a -Z
option, previously spelt -E
, for that purpose.)
One such external utility is REDIR, found within the DJGPP distribution, which supports redirecting standard output and standard error both in overwrite and in append mode, joining the streams together, and a couple of other, mostly unrelated features. Like other DJGPP programs, it requires a DPMI DOS extender to run, so it can be considered relatively heavyweight.
If you are looking for something lighter, a program named ERROUT will suffice to join standard error into standard output, which is just enough to send verbose help output into a pager.