Help with and Analyses "Version Of"

We have an executable that runs in one location for some users and another location on other computers. It also runs as a service. I’m trying to get this Analyses to work so that I can get the version of a service no matter which directory path it resides in. I’m doing something wrong here and all I’m trying to do is get the version of EDPA to display and if it doesn’t reside in one location I want it to check the other location. Notice one location is in Program Files and the other is in (x86) location.

Thanks.

version of “C:\PROGRAM FILES\Manufacturer\Endpoint Agent\edpa.exe” or version of “C:\Program Files (x86)\Manufacturer\Endpoint Agent\edpa.exe”

Well… You’d probable want to make each of these a file:

version of file "C:\PROGRAM FILES\Manufacturer\Endpoint Agent\edpa.exe" or version of file "C:\Program Files (x86)\Manufacturer\Endpoint Agent\edpa.exe"

And then you’d run into the fact that you can’t do (version) or (version). You could do something like this:

versions of files ("C:\PROGRAM FILES\Manufacturer\Endpoint Agent\edpa.exe";"C:\Program Files (x86)\Manufacturer\Endpoint Agent\edpa.exe")

or you could do…

if (exists file "C:\PROGRAM FILES\Manufacturer\Endpoint Agent\edpa.exe") then (version of file "C:\PROGRAM FILES\Manufacturer\Endpoint Agent\edpa.exe") else (if (exists file "C:\PROGRAM FILES (x86)\Manufacturer\Endpoint Agent\edpa.exe") then (version of file "C:\PROGRAM FILES (x86)\Manufacturer\Endpoint Agent\edpa.exe") else nothing))

Note that I haven’t tested any of these but they should give you a general idea

Yes, I’m cooking now! Thanks, Strawgate!