Search code examples
windows-10versionwmi

How can I determine if Windows 10 is Home regardless of PCs language settings


Finding the version of Windows 10 via registry is easy enough, but determining if Home, Pro or Enterprise not-so-much if looking for those words NOT in English.

In Win32_OperatingSystem\Caption I can see e.g. "Microsoft Windows 10 Pro"

Is there some key to check via a non-language specific way because "Home" is not the case in, say, French where is Famille and Pro is Professionnel.

Adding each possible language variation to code is beyond ugly.


Solution

  • For the use case I have there is a simple if/then to follow since I ONLY care about Home editions of Windows 10:

    You can parse the result of a WMI query of Win32_OperatingSystem\Caption. As far as I could determine, other than France, look for "Home". France got "Famille". Fine, they are very, very big on frowning on non-French words for anything. If neither of those then use the the Win32_OperatingSystem\OperatingSystemSKU. 2,3,5 and 26 are all Home edition.

    @magicandre1981 suggesting the GetProductInfo API doesn't work given this is for use via WMI, nevertheless that API underpins WMI. Nothing there that would make a difference.

    All of this falls WAY short of a bullet-proof way to know what a user actually has, but it is but IMHO works to weed out Home edition users. If anyone has a better way, please post.