Not that I know, but you can easily write one in another batch script.
call TestBatchScript.cmd > console_output.txt findstr /C:"this string" console_output.txt
sets% errorlevel% to zero if a string is found, and nonzero if a string is missing. You can then verify this with IF ERRORLEVEL 1 goto :fail and execute any code that you want after the :fail label.
If you need a compact estimate of several such lines, you can use || Syntax:
call TestBatchScript.cmd > console_output.txt findstr /C:"teststring1" console_output.txt || goto :fail findstr /C:"teststring2" console_output.txt || goto :fail findstr /C:"teststring3" console_output.txt || goto :fail findstr /C:"teststring4" console_output.txt || goto :fail goto :eof :fail echo You Suck! goto :eof
Or you can go even further and read a list of lines from a file
call TestBatchScript.cmd > console_output.txt set success=1 for /f "tokens=*" %%a in (teststrings.txt) do findstr /C:"%%a" console_output.txt || call :fail %%a if %success% NEQ 1 echo You Suck! goto :eof :fail echo Didn't find string "%*" set success=0 goto :eof
Ryan bemrose
source share