Relevance Echo Version Number Back (Program Files or X86)

(imported topic written by RobertDiRosato)

Hello,

If this works:

ECHO BACK VERSION NUMBER

If

(exist file “C:\Program Files\WinRAR\winrar.exe”)

AND

(exists version of File “C:\Program Files\WinRAR\winrar.exe”)

then

(version of File “C:\Program Files\WinRAR\winrar.exe” as string)

else

(“No Version”)

How can I make the Above work with Program files or Program Files X86. I tried below with no luck.

ECHO BACK 32 or 64 bit X86 (My Attempt but does not work)

If

(exist file “C:\Program Files (x86)\Bradford Networks\Persistent Agent\bndaemon.exe”)

or

(exist file “C:\Program Files\Bradford Networks\Persistent Agent\bndaemon.exe”)

AND

(exists version of File “C:\Program Files (x86)\Bradford Networks\Persistent Agent\bndaemon.exe”)

or

(exists version of File “C:\Program Files\Bradford Networks\Persistent Agent\bndaemon.exe”)

then

(version of File “C:\Program Files (x86)\Bradford Networks\Persistent Agent\bndaemon.exe” as string)

or

(version of File “C:\Program Files\Bradford Networks\Persistent Agent\bndaemon.exe” as string)

else

(“No Version”)

Any help would be greatly appreciated.

(imported comment written by RobertDiRosato)

I also tried this with no luck

If

(exist file “C:\Program Files (x86)\Bradford Networks\Persistent Agent\bndaemon.exe” or exist file “C:\Program Files\Bradford Networks\Persistent Agent\bndaemon.exe”)

AND

(exists version of File “C:\Program Files (x86)\Bradford Networks\Persistent Agent\bndaemon.exe” or exists version of File “C:\Program Files\Bradford Networks\Persistent Agent\bndaemon.exe”)

then

(version of File “C:\Program Files (x86)\Bradford Networks\Persistent Agent\bndaemon.exe” or version of File “C:\Program Files\Bradford Networks\Persistent Agent\bndaemon.exe” as string)

else

(“No Version”)

And also this with no Luck

If

(exist file “C:\Program Files (x86)\Bradford Networks\Persistent Agent\bndaemon.exe” or “C:\Program Files\Bradford Networks\Persistent Agent\bndaemon.exe”)

AND

(exists version of File “C:\Program Files (x86)\Bradford Networks\Persistent Agent\bndaemon.exe” or “C:\Program Files\Bradford Networks\Persistent Agent\bndaemon.exe”)

then

(version of File “C:\Program Files (x86)\Bradford Networks\Persistent Agent\bndaemon.exe” or “C:\Program Files\Bradford Networks\Persistent Agent\bndaemon.exe” as string)

else

(“No Version”)

(imported comment written by NoahSalzman)

q: (version of file “C:\Program Files\BigFix Enterprise\BES Client\besclient.exe”) as string | “No version”

A: 8.2.1093.0

q: (version of file “C:\Program Files\BigFix Enterprise\BES Client\nothing_there.exe”) as string | “No version”

A: No version

You might also try adding “x64”:

q: (version of x64 file “C:\Program Files\BigFix Enterprise\BES Client\besclient.exe”) as string | “No version”

A: 8.2.1093.0

q: (version of x64 file “C:\Program Files\BigFix Enterprise\BES Client\nothing_there.exe”) as string | “No version”

A: No version

Note that the | operator requires BigFix/TEM version 8.0 and up.

(imported comment written by RobertDiRosato)

Noah,

Thanks for the response.

I wrote it like this and it just displays no version??

version of x64 file “C:\Program Files\Bradford Networks\Persistent Agent\bndaemon.exe” as string | “No version”

Basically I have an agent called Bradford and I want to echo back it’s version number.

Now depending if it’s 32 or 64 bit the exe will be in only one of the program files folder (Program Files or Program Files (x86))

I need relevance code that will echo back the version number reguadless of where it is.

For some endpoints it will be in Program Files and others it will be in Program Files (x86)…

Any help you can provide will be greatly appreciated…

Also I am on the most current version of BigFix… Just upgraded agents as well

(imported comment written by NoahSalzman)

What do these queries return?

exists x64 file “C:\Program Files\Bradford Networks\Persistent Agent\bndaemon.exe”

exists file “C:\Program Files\Bradford Networks\Persistent Agent\bndaemon.exe”

exists version of x64 file “C:\Program Files\Bradford Networks\Persistent Agent\bndaemon.exe”

exists version of file “C:\Program Files\Bradford Networks\Persistent Agent\bndaemon.exe”

(imported comment written by RobertDiRosato)

Noah,

My File on my endpoint that I am testing is located here

C:\Program Files (x86)\Bradford Networks\Persistent Agent\bndaemon.exe

Q: exists x64 file “C:\Program Files\Bradford Networks\Persistent Agent\bndaemon.exe”

A:

False

Q: exists file “C:\Program Files\Bradford Networks\Persistent Agent\bndaemon.exe”

A:

False

Q: exists version of x64 file “C:\Program Files\Bradford Networks\Persistent Agent\bndaemon.exe”

A:

Q: exists version of file “C:\Program Files\Bradford Networks\Persistent Agent\bndaemon.exe”

A:

(imported comment written by NoahSalzman)

And what do you get with those same queries if you change the path to

C:\Program Files (x86)\Bradford Networks\Persistent Agent\bndaemon.exe

?

(imported comment written by RobertDiRosato)

I wanna create a Managed Property or a custom analyses to poll my enterprise for the version of the bradford agent.

(Via the file properties not the registry)

I have over 3000 endpoints all of which should have the bradford agent installed

There is no 64 bit bradford agent… if there is we do not use it.

So on a 64 bit windows endpoint the file would be located here:

C:\Program Files (x86)\Bradford Networks\Persistent Agent\bndaemon.exe

And on a 32 bit windows endpoint the file would be here:

C:\Program Files\Bradford Networks\Persistent Agent\bndaemon.exe

So I need relevance to determine

A: What directory the file is located in

B: Echo me back the Version number

(imported comment written by NoahSalzman)

Something like this should work:

(version of x64 file “”) as string | (version of file “”) as string | “No version”

(imported comment written by RobertDiRosato)

Noah…

Worked like a champ…

I can’t thank you enough

(imported comment written by MBARTOSH)

What is the purpose of the statement “version of x64 file” when you still have to put the value of the path as c:\program files (x86)?

(imported comment written by SystemAdmin)

The x64 isn’t actually needed as the Wow64 redirector doesn’t work on the Program Files directory set.

The following should get you the file (which you can then check for exists etc) with the current version of the agent that is available. It will be improved and made more simple in the future.

file 
"bndaemon.exe" of folder 
"Persistent Agent" of folder 
"Bradford Networks" of folder (value of variable 
"ProgramFiles" of environment) as string

The alternative is if it is a registered application (installed correctly etc) you can just say:

regapp 
"bndaemon.exe"

This returns an “application” object which you can do things with like:

q: regapp “BESClient.exe”

A: “BESClient.exe” “8.2.1364.0” “Tivoli Endpoint Manager Agent” “8.2.1364.0” “IBM Corp.”

(imported comment written by MBARTOSH)

Excellent response. Thank You for you answer!