How to recursively look for a txt file in Documents and Settings

(imported topic written by hansele8191)

Hi I’m new in this forum and new on using relevance. I need your help on creating a relevance to check on the following condition:

  • look for the existance of a text file under any subdirectory under c:\documents and settings

if the file exists, then look for a specific string on the txt file. This needs to be recursive in the event that there are multiple profiles and it should look 2 level down of documents and settings.

Example:

Imagine that we have the following profiles:

C:\documents and settings\User1\folder\test.txt

C:\documents and settings\User2\folder\test.txt

Check to see if inside test.txt the word “found” is inside the file.

Any help will be appreciated.

(imported comment written by BenKus)

Hi Hansele81,

I am going to give you relevance to do this, but be warned that if you have lots of files OR if you have very big text files, then the agent will dutifully chug through them periodically and it can slow down your BigFix Agent (or potentially the computer itself).

I suggest you make this property only evaluate once per day:

q: pathnames of files whose (name of it as lowercase contains “.txt” AND exists line whose (it as lowercase contains “found”) of it) of folders of folders of folder “C:\documents and settings”

Ben

(imported comment written by hansele8191)

Ben,

Thank you very much, it work exactly as I wanted.