Const ForReading = 1 Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.OpenTextFile("c:/scripts/test.log", ForReading) strContents = objFile.ReadAll objFile.Close i = 0 arrLines = Split(strContents, " ") For Each strLine in arrLines If InStr(strLine, "Failure") Then i = i + 1 End If Next Wscript.Echo "Number of failures: " & i