Yes
command.pl >log.txt 2>&1
From the W2K help file, Command reference, filter section (i believe this also works on older DOS after 3.2 psuedo-copied from POSIX/XENIX, but that is partly a guess):
The >& sign redirects the output from one of the default I/O streams (stdout, stdin, stderr) into another. For example, command >output_file 2>&1 redirects any error messages from the processing of command from the screen to the standard file output. The numeric values of the standard outputs are as follows: Standard output Numeric equivalent
Stdin 0
Stdout 1
Stderr 2
Main Topics
Browse All Topics





by: billiousPosted on 2003-06-25 at 06:20:58ID: 8797181
From the "Using command redirection operators" HELP on XP (2K should be the same)
Using the <& operator to redirect input and duplicate
To use the redirection input operator <&, the file you specify must already exist. If the input file exists, Cmd.exe opens it as read-only and sends the characters contained in the file as input to the command as if they were input from the keyboard. If you specify a handle, Cmd.exe duplicates the handle you specify onto the existing handle in the system.
For example, to open File.txt as input read to handle 0 (that is, STDIN), type:
<file.txt
To open File.txt, sort the contents and then send the output to the Command Prompt window (that is, STDOUT), type:
sort<file.txt
To find File.txt, and then redirect handle 1 (that is, STDOUT) and handle 2 (that is, STDERR) to the Search.txt, type:
findfile file.txt>search.txt 2<&1
To duplicate a user-defined handle 3 as input read to handle 0 (that is, STDIN), type:
<&3
Using the >& operator to redirect output and duplicate
If you redirect output to a file and you specify an existing file name, Cmd.exe opens the file as write-only and overwrites the file's contents. If you specify a handle, Cmd.exe duplicates the file onto the existing handle.
To duplicate a user-defined handle 3 into handle 1, type:
>&3
To redirect all of the output, including handle 2 (that is, STDERR), from the ipconfig command to handle 1 (that is, STDOUT), and then redirect the ouput to Output.log, type:
ipconfig.exe>>output.log 2>&1
...Not that Gates makes it easy to find!
...Bill (not /that/ Bill)