I came across a need to determine what type of OS is installed on a Windows server. The idea being that if it is a 32 bit OS, I'll get a registry key from one location but if it is a 64 bit OS, the key lives in another location.
Using WMI, I simply look up the PROCESSOR_ARCHITECTURE value.
This value is located at \\HKLM\System\CurrentControlSet\Control\Session Manager\Environment.
If you find a need for this, the code is as follows:
sHostName = "host.domain.com"
sArchitecture = ""
const HKEY_LOCAL_MACHINE = &H80000002
sEnvKeyPath = "System\CurrentControlSet\Control\Session Manager\Environment"
sEnvValue = "PROCESSOR_ARCHITECTURE"
on error resume next
Set oRegistry = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _ sHostName & "\root\default:StdRegProv")
'Read the registry to get the current processor architecture
oRegistry.GetExpandedStringValue HKEY_LOCAL_MACHINE, sEnvKeyPath, sEnvValue, sStringValue
if err.number<>0 then
sArchitecture = "Computer not found"
err.Clear()
else
sArchitecture= sStringValue
end if
WScript.Echo sArchitecture