Combining File Searches with possible multiple results

(imported topic written by SystemAdmin)

I need to look for 2 files in different locations and report the mod time if the file exists in one or both locations.

Is this possible?

I can create two analysis properties if need be, I would just prefer to combine them.

What I have so far.

q: if ( exists file "C:\Program Files\BigFix Enterprise\BES Client\besclient.exe") then modification time of file "C:\Program Files\BigFix Enterprise\BES Client\besclient.exe" as string else "<NOT_INSTALLED>"
A: Fri, 13 May 2011 14:54:32 -0500

Need something like this but that works:)

q: if ( exists file "C:\windows\besclient.exe") OR ( exists file "C:\Program Files\BigFix Enterprise\BES Client\besclient.exe") then modification time of file "C:\windows\besclient.exe" as string OR modification time of file "C:\Program Files\BigFix Enterprise\BES Client\besclient.exe" as string else "<NOT_INSTALLED>"
E: A boolean expression is required.

thanks,

Baraq

(imported comment written by jeremylam)

Probably depends on what you want the output format to be; here’s an example returning a plural string, with the path of the file and the modification time appended with a " : "

q: (if exists file (it) then it & " : " & modification time of file (it) as string else it & " : <NOT_INSTALLED>") of ("C:\Program Files (x86)\BigFix Enterprise\BES Client\besclient.exe"; "C:\Windows\System32\cmd.exe")

Here it is concatenated together with a semicolon to return a singular string:

q: concatenation " ; " of (if exists file (it) then it & " : " & modification time of file (it) as string else it & " : <NOT_INSTALLED>") of ("C:\Program Files\BigFix Enterprise\BES Client\besclient.exe"; "C:\Windows\System32\cmd.exe")

(imported comment written by SystemAdmin)

This works perfectly! I ended up using that 2nd snippet.

Thank you so much,

Baraq