I am trying to figure out if there is a location in WMI that will return the OS Architecture (i.e. 32-bit or 64-bit) that will work across \"all\" versions of Windows. I though
If you need the Operating System architecture as opposed to the processor, this works if you're confident you have no 64 bit Windows 5.x systems:
Set colItems = objWMI.ExecQuery("Select * from Win32_OperatingSystem",,48)
on error resume next
For Each objItem in colItems
Ver = objItem.Version
OSname = split(objItem.Name,"|")
Arch = "32-bit"
if left(Ver,3) >= 6.0 then ' 5.x doesn't support this property
Arch = objItem.OSArchitecture
end if
Next
wscript.echo " OS Version: " & Ver & " {" & trim(OSname(0)) & " " & Arch & "}"