How to find the build / version of Windows 10

GUI: Settings, System, About

Not sure if this is the 'proper' way, but you can get the Win10 vocalized/talked-about 'version' (1511, 1607, etc.) via this cmd:

Reg Query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ReleaseId

Here is Microsoft's page to correlate build numbers to Win10 'version' (backup link [wiki] just in case). Helped me when I get build # from remote PC: wmic /node:HOSTNAME os get BuildNumber


WMI does not currently have properties that can be used to completely identify the Windows 10 version (like 1607) or full build number (like 10.0.14393.577). As stated in other comments, this information is visible in the registry under this key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion

The following values in that key correspond to the information displayed by the winver.exe program:

ReleaseID = Version (name based on year/month of release: 1507, 1511, 1607, 1703, etc.)
CurrentBuild or CurrentBuildNumber = OS Build (part before period)
UBR = OS Build (part after period)

Additionally, the version numbers are in these two values from that registry key:

CurrentMajorVersionNumber = 10
CurrentMinorVersionNumber = 0

The build changes when the Version (like 1607) changes or when Insider builds are installed. However, the UBR (Update Build Revision) does change with certain updates as indicated in Microsoft's release list.

In PowerShell,

[System.Environment]::OSVersion.Version

returns Major, Minor, and Build the same as the registry key, but it always seems to report Revision as 0. A bit of code from a Reddit user provides an adequate replacement that includes the UBR from the registry as the Revision number:

$WinVer = New-Object -TypeName PSObject
$WinVer | Add-Member -MemberType NoteProperty -Name Major -Value $(Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion' CurrentMajorVersionNumber).CurrentMajorVersionNumber
$WinVer | Add-Member -MemberType NoteProperty -Name Minor -Value $(Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion' CurrentMinorVersionNumber).CurrentMinorVersionNumber
$WinVer | Add-Member -MemberType NoteProperty -Name Build -Value $(Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion' CurrentBuild).CurrentBuild
$WinVer | Add-Member -MemberType NoteProperty -Name Revision -Value $(Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion' UBR).UBR
$WinVer

Checking the version or the build number of Windows 10 is not very helpful because it doesn't change over time.

It turns out that first sentence is wrong; it was true in all previous versions of Windows, but we are in a new Windows 10 world now. The latest insiders build has a build number of 10525 compared to "RTM": 10240.

There are several ways to get the build number on the command line:

systeminfo.exe
(Get-CimInstance -ClassName Win32_OperatingSystem -Namespace root/cimv2).BuildNumber
(Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name CurrentBuild).CurrentBuild

The last of the three is the fastest.

If you prefer the GUI, you can use winver.exe or the About entry in the Help menu of most Windows desktop applications.

With no service packs around any more, the patch-level on the OS depends on the installed updates. There are several ways to find these, GUI, systeminfo.exe, wmi, etc.

The recommended and most powerful way to do things like this is using PowerShell:

Get-HotFix

shows something like:

Source        Description      HotFixID      InstalledBy          InstalledOn
------        -----------      --------      -----------          -----------
WIN10         Security Update  KB3074663     NT AUTHORITY\SYSTEM  7/17/2015 12:00:00 AM
WIN10         Security Update  KB3074667     NT AUTHORITY\SYSTEM  7/21/2015 12:00:00 AM
WIN10         Security Update  KB3074674     NT AUTHORITY\SYSTEM  7/24/2015 12:00:00 AM
WIN10         Update           KB3074678     NT AUTHORITY\SYSTEM  7/31/2015 12:00:00 AM

You can filter for updates in the last 10 days:

Get-Hotfix | Where {$_.InstalledOn -gt $(Get-Date).AddDays(-10) -and $_.Description -eq "Update"}

Or show the last three installed updates:

Get-Hotfix | Sort-object InstalledOn -Descending | Select -First 3

You can check whether a specific update is installed:

if ((get-hotfix -id kb3087916) -ne $null) {"patched..."}

You can first find the latest patch kb number online like:

(New-Object Net.WebClient).DownloadString('https://microsoft.com/...')

And then check whether it exists on the machine.

Note: this is just an example. I don't know of a page that currently lists these, and you still have to parse it.

The question is: Over time, will Microsoft change the functionality of Windows 10 so much that you have to check for it to make your app or script work.

It may be a better idea to check whether a specific feature you need exists on the system, rather than to look for a version number.

Tags:

Windows