#161700 - 2006-05-0711:40 AMRe: Running in VMWare ...
NTDOCNTDOC Administrator
Registered: 2000-07-28
Posts: 11629
Loc: CA
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.