How can I find the file name and version which exist on program file folder or program files (x86)

How can I find the file name and version which exist on program file folder or program files (x86)…

I have created below set of relevance but its not working on both type of systems

Working on system where Program Files (x86) exist and not working on Program Files.

Q: exists file “edpa.exe” of system x64 folder
A: False
T: 4.582 ms

Q:version of file "C:\Program Files\Manufacturer\Endpoint Agent\edpa.exe"
A: 15.0.117.1001
T: 3.633 ms

Q:if (exists x64 file “C:\Program Files\Manufacturer\Endpoint Agent\edpa.exe”) then ((version of x64 file “C:\Program Files\Manufacturer\Endpoint Agent\edpa.exe”) as string) else "Does Not Exist"
A: 15.0.117.1001
T: 2.725 ms

Q:(name of it, size of it) of file “edpa.exe” of (“C:\Program Files\Manufacturer\Endpoint Agent\edpa.exe”; “C:\Program Files\Manufacturer\Endpoint Agent\edpa.exe”)
E: The operator “file” is not defined.

q: if (exists file (“C:” & (if (architecture of operating system = “x86_64”) then “program files (x86)” else “program files”) & “Manufacturer\Endpoint Agent\edpa.exe”))then (version of file (“C:” & (if (architecture of operating system = “x86_64”) then “program files (x86)” else “program files”) & “Manufacturer\Endpoint Agent\edpa.exe”)) else "Does Not Exist"
E: Incompatible types.

Q:if (exists file “C:\Program Files\Manufacturer\Endpoint Agent\edpa.exe”) then "edpa | " & version of file “C:\Program Files\Manufacturer\Endpoint Agent\edpa.exe” as string else "N/A"
A: edpa | 15.0.117.1001
T: 1.352 ms

Here’s an example from my machine…

q: (pathname of it, version of it) of files ("notepad++.exe";"putty.exe") of folders ("notepad++";"putty") of (program files x32 folders; program files x64 folders)
A: C:\Program Files (x86)\notepad++\notepad++.exe, 7.6.2.0
A: C:\Program Files\putty\putty.exe, 0.70.0.0

I believe you should be able to refactor your query to

(name of it, version of it) of files "Manufacturer\Endpoint Agent\edpa.exe" of (program files x32 folders; program files x64 folders)
1 Like

Yes… Its working properly and its also clear my concept about x32 and x64 location.

Thanks Jason for your prompt support… :slight_smile: