FileSearch with folder location

I am using the analysis section and trying to search a computer’s hard drive for a specific file and return its location. The statement currently works but I have tried multiple other things to try and return the location of the file instead of “true”.

This is currently what i am using to complete the search:
exists descendant whose (name of it as lowercase contains “FILENAME”) of root folders of drive “c:”

Any help would be much appreciated.

try using the “pathname” inspector. Just be cautious of scanning drives for files because it is resource intensive, depending on how often the evaluation runs.

q: pathname of file “test.txt” of folder "c:\test"
A: c:\test\test.txt
T: 0.387 ms
I: singular string

I have tried the pathname of file, but since i dont know where the file resides I don’t know where I should be targeting. is there anyway to take the output from

exists descendant whose (name of it as lowercase contains “FILENAME”) of root folders of drive “c:”

and return the result?

the output of descendants is the file so asking for the pathname of the descendants seems to work.

 q: pathname of descendant whose (name of it as lowercase contains "test.txt") of folder "test" of drive "c:"
    A: c:\test\test.txt
    T: 0.912 ms
    I: singular string

Be aware as commented already here that using the descendant inspector this way is strongly discouraged as it could take hours to complete if it is even capable of completing. It is far easier to have a small shell script program or something search for a file in an action and look at those results. Your system can be blocked from doing a lot more things by performing a search like this.

I have actually limited to just scanning the USER folder and all descendants as it looks like that the prime place where the file has been stashed away.

Thanks for the help!