If you don't like that method you could use one like this then or a combination of all the suggestions posted here.

Break On
Dim $SO
$SO=SetOption('Explicit','On')
$SO=SetOption('NoVarsInStrings','On')
$SO=SetOption('NoMacrosInStrings','On')

Dim $VMRunning,$Item
$VMRunning = VMwareRunning()
If @ERROR
'Error checking VMware Service State. ' + @ERROR + ' - ' + @SERROR ?
Else
For Each $Item In $VMRunning
If $Item
$Item ?
EndIf
Next
EndIf

Function VMwareRunning()
Dim $VMTools $VMTools = 0
Dim $VMProcess $VMProcess = 0
Dim $VMToolsRunning $VMToolsRunning = 0
Dim $Key, $ChkWMI
$Key = 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run'
$VMTools = ReadValue($Key,'VMware Tools')
$VMProcess = ReadValue($Key,'VMware User Process')
If 1 = KeyExist('HKLM\SYSTEM\CurrentControlSet\Services\VMTools')
$ChkWMI = WMIConfirm()
If @ERROR
Exit @ERROR
Else
If $ChkWMI > 1
$VMToolsRunning = fnWMIService('VMTools','STATE')
EndIf
EndIf
Else
$VMwareRunning = 0
EndIf
$VMwareRunning = $VMTools, $VMProcess, $VMToolsRunning
EndFunction

Function WMIConfirm(optional $sComputer)
Dim $objWMIService, $objWMISetting, $colWMISettings
$sComputer = IIf(Not $sComputer,'','\\'+Join(Split($sComputer,'\'),'',3)+'\')
$objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!"+$sComputer+'root\cimv2')
; Failed - return 0 and exit with error value
If @ERROR
$WMIConfirm = 0
Exit Val('&' + Right(DecToHex(@ERROR), 4))
EndIf
$colWMISettings = $objWMIService.ExecQuery("Select * from Win32_WMISetting")
For Each $objWMISetting In $colWMISettings
$WMIConfirm = $objWMISetting.BuildVersion
Next
Exit 0
EndFunction

Function fnWMIService($sService,$sMethod,Optional $sComputer)
Dim $objWMI,$objSrvc,$nul
If Not $sComputer $sComputer=@WKSTA EndIf
$objWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\"+$sComputer+"\root\cimv2")
If @ERROR<0 Exit VAL("&"+Right(DecToHex(@ERROR),4)) EndIf
$objSrvc = $objWMI.ExecQuery('Select * from Win32_Service WHERE Name = "'+$sService+'"')
For Each $objSrvc in $objSrvc
$nul=Execute("$"+"fnWMIService = $"+"objSrvc."+$sMethod)
Next
EndFunction