When I try to get version of a file wuaueng.dll (Windows Update Agent) from windows 7 and windows 10, i only get results form 32 bit OSes. 64-bit OSes doesnt return any result, although the file is in the same directory for both 32 or 64 bit OSes ( C:\Windows\system32 )
if exist file "wuaueng.dll" of folder "C:\Windows\System32" then (version of file "wuaueng.dll" of folder "C:\Windows\System32" as string) else ("<n/a>")
The Bigfix agent is 32-bit, so unless you tell it to, it will look in the 32-bit folders.
You just need to give it a better hint.
Your code:
q: if exist file "wuaueng.dll" of folder "C:\Windows\System32" then (version of file "wuaueng.dll" of folder "C:\Windows\System32" as string) else ("<n/a>")
A: <n/a>
I: singular string
This is the same as:
q: if exist file "wuaueng.dll" of system x32 folder then (version of file "wuaueng.dll" of system x32 folder as string) else ("<n/a>")
A: <n/a>
I: singular string
On a 64-bit system you could use
q: if exist file "wuaueng.dll" of system x64 folder then (version of file "wuaueng.dll" of system x64 folder as string) else ("<n/a>")
A: 7.9.9600.18696
I: singular string
but that will not be happy on a 32-bit machine
Options:
q: if exist file "wuaueng.dll" of native system folder then (version of file "wuaueng.dll" of native system folder as string) else ("<n/a>")
A: 7.9.9600.18696
I: singular string
q: if exist file "wuaueng.dll" of (system x32 folders; system x64 folders) then unique values of (version of it as string) of file "wuaueng.dll" of (system x32 folders; system x64 folders) else "N/A"
A: 7.9.9600.18696
I: plural string
I was testing both options you provide. Both options works only on Server 2012 R2.
I get The operator “native system folder” is not defined. on WIn7, Win10 when running first option you provide.
Second option only works for 64bit OSes, on 32 bit I get Singular expression refers to non-unique object.
Sorry for the confusion, but i thought your second option would work on both 32 or 64 OSes.
For now, it looks like I have to make 2 relevances. One for x32 and one for x64.
I’m not sure 8.2 even support for a 64-bit client. Sure there are cases for running older clients on older machines (where a new client may not be available, for winxp for example), but a Win Server 2012 R2 should really be running a 9.x client.