I have scripted StdErr.bat to generate output on StdErr, so that it is separate from the normal output on StdOut.

The syntax for using StdErr.bat is:

\[call\] StdErr Message

Where Message is a double-quoted string that you wish to display on StdErr.

Sample Usage:

If you wanted to redirect the output of a script to a file, but provide immediate display of some messages:
. . .                              . . .                              If "%AOK%" EQU "N" goto err                              @echo %line%>>%ReportFile%                              . . .                              goto . . .                              :err                              call StdErr "Line %line% has an error."                              . . .
StdErr.bat contains:
@echo off                              setlocal                              if exist "%TEMP%\StdErr.vbs" goto out                              @echo dim err>"%TEMP%\StdErr.vbs"                              @echo Set objshell = CreateObject("WScript.Shell")>>"%TEMP%\StdErr.vbs"                              @echo Set objArgs = WScript.Arguments>>"%TEMP%\StdErr.vbs"                              @echo err=objArgs(0)>>"%TEMP%\StdErr.vbs"                              @echo WScript.StdErr.Writeline err>>"%TEMP%\StdErr.vbs"                              :out                              if \{%1\}==\{\} goto outNone                              cscript //nologo "%TEMP%\StdErr.vbs" %1                              endlocal                              goto :EOF                              :outNone                              cscript //nologo "%TEMP%\StdErr.vbs" "No Parameter Provided."                              endlocal