How can I determine the Windows version from a VB 6 app?

后端 未结 7 912
野趣味
野趣味 2020-12-09 04:10

I want to detect any Windows versions from 95 to Win 7.

I also would like to display if the OS is 32-bit or 64-bit.

That\'s it; it\'s that simple. :) What co

7条回答
  •  被撕碎了的回忆
    2020-12-09 04:33

    Here is a very simple method I use to determine 32 vs. 64 bit operating system:

    OSBits = IIf(Len(Environ$("PROGRAMFILES(X86)")) > 0, 64, 32)
    

    In 64-bit Windows, the OS sets the environment variable "PROGRAMFILES(X86)" but it doesn't on 32-bit systems. It hasn't failed me yet...

提交回复
热议问题