Here Shawn,

This code will tell you IF you're running under a VMware hosted Windows session.
Not tested on GSX/ESX but should work on them as well due to the nature of the check.

If the system is not running the VMware Tools then it's not setup very well, and if it's
not running the VMware Tray then it's been highly modified and is unlikely.

This method should work even if WMI is broken and a little faster as well.
 


Dim $VMRunning
$VMRunning = WithinVMware()
If $VMRunning = 1
'Logon is running under a VMware session.' ?
Else
'Logon is NOT running under a VMware session.' ?
EndIf

Function WithinVMware()
Dim $InWMware
$InWMware = 0
Select
Case 1 = KeyExist('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\VMip.exe')
$InWMware = 1
Case 1 = KeyExist('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\VMwareTray.exe')
$InWMware = 1
Case 1
EndSelect
$WithinVMware = $InWMware
EndFunction