Can anybody help me find a way to display or redirect console output to a
file, or provide a means to capture it all so that I can read it, perhaps
to log all that is displayed in the ms-dos window. In the olden days we
used to use cntl/p to print but in these days of print servers this just
locks up the system. Also we used to use cntl/s and cntl/q to stop and
start display but today with fast computers this has no practical use -
things are all virtually instant.
Your expert help would be appreciated.
Best Regards
Neil Hollingum
There are assorted third-party utilities for this sort of thing,
but here's a quick workaround that often helps.
For example, the command
DIR NOFILE::
will generate an error message that can't be redirected to a file.
However, if you run it in a COMMAND.COM child shell with all
output constrained to the Printer, you'll find the full display is
printed (non-redirectable messages and all). So this will print
the full DIR display including error message:
command PRN /c DIR NOFILE::
So try:
command PRN /c YourCommandName /help
(use whatever the help switch is). You'll often find you can
snatch the Printer file from C:\WINDOWS\SPOOL\PRINTERS
and read it as a file, too.
--
(pp) William Allen
Is there a way to redirect non-redirectable messages to a file rather
than the printer (from within a batch file)?
>"Neil Hollingum" wrote in message
>> I am trying to use some ucd-snmp utilities ported to windows. The utilities
>> provide snmp functions and seem to work fine. They allow the display of
>> "help" information to the console but this is so long it goes beyond the
>> maximum 50 lines of output allowed on an MS-dos window in windows-98. I
>> have tried using the "> filename" redirection qualifier but this has no
>> effect on the output, it is still sent to the screen.
>
>There are assorted third-party utilities for this sort of thing,
>but here's a quick workaround that often helps.
>
>For example, the command
>DIR NOFILE::
>will generate an error message that can't be redirected to a file.
William, I can't believe you missed an opportunity.... Are you
feeling okay? <G>
Advanced CMD.EXE redirection operators (also in Win95Cmd and 4NT):
1> redirect stdout handle, overwrite output file if it exists
1>> redirect stdout handle, append to output file if it exists
2> redirect stderr handle, overwrite output file if it exists
2>> redirect stderr handle, append to output file if it exists
2>&1 redirect stderr to same handle as stdout
1>&2 redirect stdout to same handle as stderr
More than one operator may be used to redirect more than one stream;
they may be redirected to the same or to different files or devices.
Other digits may be used, referring to other file handles, but only
1 and 2 (stdout and stderr) are generally useful.
Advanced 4DOS redirection operators (also work in 4NT, TC/32, etc.):
>& redirect stdout and stderr, overwrite output file
>&> redirect stdout only, overwrite output file
>>& redirect stdout and stderr, append to output file
>>&> redirect stdout only, append to output file
>&! redirect stdout and stderr, overwrite, override NoClobber
>&>! redirect stdout only, overwrite, override NoClobber
>>&! redirect stdout and stderr, append, override NoClobber
>>&>! redirect stdout only, append, override NoClobber
|& pipe stdout and stderr from left command to right command
Sadly, none of the above exist in any version of COMMAND.COM so
far as I am aware.
--
Charles Dye ras...@highfiber.com