I have a batch file that checks if a file exists, then executes a command (sends an email if condition is true). Now I would like to add an AND command (don't know if it's possible in batch) to check if the file contains a piece of text.
For example, in simple text, something like this:
IF file test.txt exists
AND if test.txt contains "test1"
OR if test.txt contains "test2"
OR if test.txt contains "test3"
THEN execute command
My temporary batch file is as follows:
if exist test.txt
bmail -s (IP address here) -t (e-mail addresses here) -f Test_System -a "Test Problem" -m test.txt
Hence, I would like to add to this batch file the file scanning part stated earlier.
Any help would be appreciated.