Finding first 5 characters of file version for VMWare VMTools

(imported topic written by FITZPAW91)

Hi All

I am trying to write a relevance that will identify the version of a file installed, which will help me identify and upgrade the version of VMTools installed on Virtual Machines. I have been able to identify the versions, but can’t figure out how to identify only the 3.5.0 versions and not the 4.0.0 versions. Here is the relenvance

if exists file (“C:\Program Files (x86)\VMware\VMware Tools\VMwareService.exe”) then (values “FileVersion” of version blocks of files (“C:\Program Files (x86)\VMware\VMware Tools\VMwareUser.exe”)) else (values “FileVersion” of version blocks of files (“C:\Program Files\VMware\VMware Tools\VMwareUser.exe”))

This outputs (for different VMs)…

3.5.0 build-213532

4.0.0 build-208167

I need it to identify only the ones that start with 3.5.0 and have smaller build numbers thant 213532 to be relevant for the upgrade of the VMTools.

Thanks for the Help

William

(imported comment written by Lee Wei)

Hi William,

You can try the following.

q: (“3.5.0 build-213532”; “4.0.0 build-208167”)

A: 3.5.0 build-213532

A: 4.0.0 build-208167

q: (first 5 of it = “3.5.0” and following text of first “build-” of it as integer < 213532) of (“3.5.0 build-213532”; “4.0.0 build-208167”)

A: False

A: False

q: (first 5 of it = “3.5.0” and following text of first “build-” of it as integer < 213532) of (if exists file (“C:\Program Files (x86)\VMware\VMware Tools\VMwareService.exe”) then (values “FileVersion” of version blocks of files (“C:\Program Files (x86)\VMware\VMware Tools\VMwareUser.exe”)) else (values “FileVersion” of version blocks of files (“C:\Program Files\VMware\VMware Tools\VMwareUser.exe”)))

Lee Wei

(imported comment written by FITZPAW91)

Hi Lee

Seems to work great, thanks alot for the help, you just saved me hours of work.

William

(imported comment written by SystemAdmin)

A little better way of getting the same result without using static paths

Q: (first 5 of it = “3.5.0” and following text of first “build-” of it as integer < 213532) of (if exists running application “VMwareService.exe” then values “FileVersion” of version blocks of running applications “VMwareService.exe” as string else “”)

Is there any option to get the VMware tools version for Linux/UNix servers.

Anything like this for - LInux/Unix
https://bigfix.me/analysis/details/2998379