question

OSD-4642 avatar image
0 Votes"
OSD-4642 asked OSD-4642 commented

Windows 10 Version and Buil Number with VB.Net

Hi,

I would like to get Windows Version (let's say 202H) and OS build (like 19042.928), as highlighted in below screenshot.
94332-image.png

Using Win32_OperatingSystem in VB.Net as ("root\CIMV2", "SELECT * FROM Win32_OperatingSystem")
And I am able to get partial build number 19042 using "BuildNumber" property of the Win32_OperatingSystem class ( win32-operatingsystem) However, I not able to figure out how to get:
1. The remaining part of the build number (928 in this example).
2. The Windows version like 20H2 (highlighted in green color in the screenshot).


dotnet-visual-basic
image.png (17.9 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

LeonLaude avatar image
1 Vote"
LeonLaude answered LeonLaude edited

Hi @OSD-4642,

The Win32_OperatingSystem class can only retrieve the BuildNumber which is 19042 in your case, the last three (3) digits is the revision number of the build, to retrieve the revision number I believe you will have to query the Windows Registry.


(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)


Best regards,
Leon

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

OSD-4642 avatar image
0 Votes"
OSD-4642 answered LeonLaude edited

Will check that Leon.
And how about the Version 20H2? Is it not supported as well?

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I believe it's not supported either, it can be located in the Windows Registry over here:
94393-version-displayname.png


0 Votes 0 ·
OSD-4642 avatar image
0 Votes"
OSD-4642 answered OSD-4642 commented

Great, I can get "DisplayVersion" now from Registry.
However, in this hive, there is no such value like revisionID, I only have releaseID which is not same as last three numbers ....

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks Leon, Now I have both attributes that I was looking for in Win32_OperatingSystem class.

0 Votes 0 ·