Originally Posted By: Richard H.
Well, you can do it quicker, nastier and get more accurate results ;\)


I agree ;\)
 Code:
$sFile="c:\boot.ini"
$oFSO=CreateObject("Scripting.FileSystemObject")
$oFile=$oFSO.OpenTextFile($sFile, 1, -1)
$sFileData=$oFile.ReadAll

? "The word 'professional' appears "+UBound(Split($sFileData,"professional"))+" times in the file"
? "The word 'xp' appears "+UBound(Split($sFileData,"xp"))+" times in the file"
? "The word 'timeout=30' appears on its own on "+UBound(Split($sFileData,@CRLF+"timeout=30"+@CRLF))+" lines in the file"
? "The letter 'r' appears "+UBound(Split($sFileData,"r"))+" times in the file"