How to determine OS Platform with WMI?

后端 未结 13 3522
無奈伤痛
無奈伤痛 2021-02-20 03:46

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

13条回答
  •  一个人的身影
    2021-02-20 04:44

    After awhile of searching and testing, I've come up with a "fix/answer" although it's not exactly what I was hoping for. Performing the query from via the Registry appears to be consistent across all the version I have in my lab for Win2k3 & Win2k8. Here's where I am pulling the information from:

    HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Environment
    
    KEY: PROCESSOR_ARCHITECTURE
    

    It displays x86 or AMD64. It's not perfect, but at least it gives me the proper answer every time.

    Still, if anyone knows a consistent 'Class' or Registry key that will output 32/64, 32-bit/64-bit, or X86/X64, I would greatly appreciate the information.

提交回复
热议问题