I\'m trying to redirect all output (stdout + stderr) of a DOS command to a single file:
C:\\>dir 1> a.txt 2> a.txt
The process cannot access the fil
In a batch file (Windows 7 and above) I found this method most reliable
Call :logging >"C:\Temp\NAME_Your_Log_File.txt" 2>&1
:logging
TITLE "Logging Commands"
ECHO "Read this output in your log file"
ECHO ..
Prompt $_
COLOR 0F
Obviously, use whatever commands you want and the output will be directed to the text file. Using this method is reliable HOWEVER there is NO output on the screen.