How to check a file for presence of given string?

How can I check a file’s content? Question: I want to activate a particular notification if a file includes specific information. How can I achieve this? Answer: IPNetwork Monitor comes with several example custom monitors. One such script examines a file’s contents (and retrieves a designated value). This VBScript (file_content.vbs) helps locate specific text within a given file. To utilize it, find the **ipnetwork_file_content.vbs** file in the scripts directory of your IPNetwork Monitor installation and select the ‘Run Script’ program type. The required parameters are: filename mode string credentials Here, ‘filename’ represents the file’s name, ‘mode’ is either ‘C’ (count – determine the number of instances of ‘string’) or ‘F’ (locate the initial numeric string following the first occurrence of ‘string’); credentials, if supplied, follow the same format as the ‘-l’ parameter for the dirsize_kb example program included with IPNetwork Monitor. A command line illustration:
"C:\ProgramData\IPNetwork Monitor\logs\error.log" C shutdown
(meaning, analyze the IPNetwork Monitor error log and report the quantity of ‘shutdown’ strings encountered) As an example, you can establish a Custom Monitor with these settings:
Related Topics
How can I monitor directory size?