The easiest way to quickly find out the version and build number of the Windows OS that is installed on your computer is to press the Win+R
on the keyboard and run the winver
command.
The following screenshot shows that Windows 10 version 22H2 is installed on the computer (build number 19045.3324). Both the release number and the build number of Windows allow you to uniquely identify the version of the operating system installed on your computer.
You can also open the System Information dialogue using a Win+Pause
keyboard shortcut. This will take you to the appropriate Settings
section (System -> About) or the System Properties window (depending on your version of Windows).
shell:::{bb06c0e4-d293-4f75-8a90-cb05b6477eee}
Also, you can get info about your computer’s Windows build and version from the command line. Run the command:
systeminfo
Command output can be filtered:
systeminfo | findstr /B /C:"OS Name" /B /C:"OS Version"
Or use the WMI command:
wmic os get Caption, Version, BuildNumber, OSArchitecture
The PowerShell equivalent of the systeminfo
command is the Get-ComputerInfo cmdlet:
Get-ComputerInfo | select OsName, OsVersion, WindowsVersion, OsBuildNumber, OsArchitecture
The disadvantage of the Get-ComputerInfo cmdlet is that its execution is rather slow. If you need to quickly check the Windows version and build from a PowerShell script, it is better to use one of the following commands.
Get the Windows version with the environment variable:
[System.Environment]::OSVersion.Version
From the WMI class:
Get-WmiObject -Class Win32_OperatingSystem | fl -Property Caption, Version, BuildNumber
In new versions of PowerShell Core, you must use Get-CimInstance instead of the Get-WmiObject cmdlet:
Get-CimInstance Win32_OperatingSystem | fl -Property Caption, Version, BuildNumber, OSArchitecture
To find out the build and version number of Windows, you can also check the registry.
Reg Query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName
Reg Query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v DisplayVersion
Reg Query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v CurrentBuild
Or:
Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion"| select ProductName, DisplayVersion, CurrentBuild
ProductVersion
, TargetReleaseVersion
, and TargetReleaseVersionInfo
registry parameters in the HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate registry key to specify the maximum target Windows build your device can automatically upgrade to. These options can be used to prevent an automatic update to Windows 11.Use PowerShell Remoting to check the Windows version on remote hosts:
Invoke-Command -ScriptBlock {Get-ItemProperty 'HKLM:SOFTWARE\Microsoft\Windows NT\CurrentVersion' | Select-Object ProductName, ReleaseID, CurrentBuild} -ComputerName dskt-pc01
Or use WMI/CIM:
Get-ciminstance Win32_OperatingSystem -ComputerName dskt-pc01 | Select PSComputerName, Caption, OSArchitecture, Version, BuildNumber | FL
If your computer is joined to the Active Directory domain, you can get the Windows version and build from the computer’s attributes in AD (Getting Windows OS build numbers from Active Directory).