Originally Posted By: apronk
Script echo's a number for the times the word was found and 0 if it wasn't found at all.


There are a couple of issues with your search scriptlet which may or may not cause a problem depending on how the file is structured.

1. You are counting the number of lines that the word might appear on, *not* the number of times that the word appears. If the word appears twice on one line you will only count it once. Think about using Split() and Ubound() as a fast way of counting how many times a word appears in a string - you can then use .ReadAll instead of enumerating each line.

2. More relevant to this post, the InStr() will match substrings, so if the workstation is called "PC1" it will match "PC1", "PC13", "NotReallyPC1AtAll" and so on.