Saturday, 15 September 2007

I found this page which lists "all" you can do with microsoft windows/dos batch file redirection. It does not have totally clear descriptions, but it's not bad. One redirect which is useful is

Duplicating handles
The & redirection operator duplicates output or input from one specified handle to another specified handle. For example, to send dir output to File.txt and send the error output to File.txt, type:
dir>c:\file.txt 2>&1

or

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