\
Tips and Tricks
Batch Files
Batch File Tips and Tricks
Does a File Contain Some Text?
| Does a File Contain Some Text? |
The "find" command can return a return code of zero if a file
contains some text.
echo SanityCheck1 > "%OutputFile%" 2>&1
SomeProcess.exe > "%OutputFile%" 2>&1
type "%OutputFile%"
find "failed" "%OutputFile%"
if errorlevel 1 goto FAILED_FOUND
echo *** Command Worked ***
Of course "FindStr.exe" and many other tools (like "grep.exe")
would allow you to use regular expressions to find more complicated
types of matches.