I invite you to review
this related post. For example, using this test Batch file:
Code: Select all
@echo off
echo This line to Stdout
ping -n 2 -w 1 localhost > NUL
echo THIS LINE IS AN ERROR! >&2
ping -n 2 -w 1 localhost > NUL
echo This line is normal
ping -n 2 -w 1 localhost > NUL
echo Another line to Stderr >&2
ping -n 2 -w 1 localhost > NUL
echo The last normal line
... and execute it this way:
Code: Select all
"test.bat" 2>&1 1>&3 | AnsiSys.exe 4E
.. show this output:
You may also use FINDSTR to mark the lines from StdErr in this simpler way:
Code: Select all
test.bat 2>&1 1>&3 | findstr /A:4E /N "^"
... but in this case just
the numbers of the lines from Stderr will be displayed in other color.
Antonio