Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get Windows Version - as in "Windows 10, version 1607"?

Tags:

c#

windows

It seems that the word "version" in reference to Windows is used for different things. For example, the Windows 10 "Anniversary Update" is labeled "Version 1607" by Microsoft (here for example). But if I try to get the "Version" (on a PC with the Anniversary Update installed) using the following code, nothing is returned that looks like "1607".

// Get Version details Version ver = os.Version; Console.WriteLine("Major version: " + ver.Major); Console.WriteLine("Major Revision: " + ver.MajorRevision); Console.WriteLine("Minor version: " + ver.Minor); Console.WriteLine("Minor Revision: " + ver.MinorRevision); Console.WriteLine("Build: " + ver.Build); 

I get this:

Major version: 6 Major Revision: 0 Minor version: 2 Minor Revision: 0 Build: 9200 

How do I get the Windows 10 "version" as in "Version 1607"?

Thanks!

like image 255
Joe Gayetty Avatar asked Sep 29 '16 19:09

Joe Gayetty


People also ask

How do I find my 1607 version?

Windows 10 Anniversary Update, which includes additional features and improvements, will automatically download and install when it's available. If you want to check for the update now, select the Start button, then select Settings > Update & security > Windows Update > Check for updates.

Can I update Windows 10 version 1607?

This update is available through Windows Update. It will be downloaded and installed automatically.

What does 1607 mean in the version of Windows 10?

The second line in the “About Windows” box tells you which version and build of Windows 10 you have. Remember, the version number is in the form YYMM—so 1607 means the 7th month of 2016.


1 Answers

according to MSDN official link there's a specific version number for each windows version out there. in dot net this can be read using the Environment.OSVersion object.

Console.WriteLine("OSVersion: {0}", Environment.OSVersion); //output: OSVersion: Microsoft Windows NT 6.2.9200.0 

What you are looking for is called ReleaseID not a version of windows. this be can read from registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ReleaseId

using Microsoft.Win32;  string releaseId = Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "ReleaseId", "").ToString(); Console.WriteLine(releaseId); 
like image 107
Stavm Avatar answered Sep 24 '22 02:09

Stavm