We have the following unix command:
/usr/bin/tail -n 1 %{path} | grep --silent -F \"%{message}\" && rm -f %{path}%
This:
You can use tailhead.bat (pure batch script utility) that can be used to show lasts/fists lines of a file.Instead of Grep you can use findstr or find :
Grep
findstr
find
tailhead.bat tailhead -file=%pathToFile% -begin=-3|find "%message%"