Windows has multiple command line utilities that can help find the version of the Windows OS running on your computer. Below is the list of commands and the information they provide.
Systeminfo
command – Windows OS name, version, edition and build numberWMIC
command – OS name and versionVer
command – OS version
Find OS Version from command line(CMD)
Systeminfo is a useful command that can dump information about hardware and software running on your computer. Since we are interested in only the OS details, we can filter out other information with the use of findstr
command.
systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
Examples:
C:\>systeminfo | findstr /B /C:"OS Name" /C:"OS Version" OS Name: Microsoft Windows 10 Enterprise OS Version: 10.0.19042 N/A Build 19042
This command works on Windows 19, Windows and on Server editions also. Find example for Windows 7 below.
systeminfo | findstr /B /C:"OS Name" /C:"OS Version" OS Name: Microsoft Windows 10 Enterprise OS Version: 10.0.19042 N/A Build 19042
In case of Windows 7 SP1, the output would be slightly different as below.
c:\>systeminfo | findstr /B /C:"OS Name" /C:"OS Version" OS Name: Microsoft Windows 7 Enterprise OS Version: 6.1.7601 Service Pack 1 Build 7601
If you want to print more details, you may use just ‘OS’ in the findstr search pattern. See example below for Server 2008.
C:\>systeminfo | findstr /C:"OS" OS Name: Microsoft Windows Server 2008 R2 Enterprise OS Version: 6.1.7600 N/A Build 7600 OS Manufacturer: Microsoft Corporation OS Configuration: Standalone Server OS Build Type: Multiprocessor Free BIOS Version: IBM -[BWE117AUS-1.05]-, 7/28/2005
Check Windows version using WMIC command
Run the below WMIC command to get OS version and the service pack number(Windows 7 and prior versions).
wmic os get Caption,CSDVersion /value
Example on Windows 10:
c:\>wmic os get Caption,CSDVersion /value Caption=Microsoft Windows 10 Enterprise CSDVersion=
Example on Windows 7:
c:\>wmic os get Caption,CSDVersion /value Caption=Microsoft Windows 7 Enterprise CSDVersion=Service Pack 1
If you want to find just the OS version, you can use ver command. Open command window and execute ver command. But note that this does not show service pack version.
C:\>ver Microsoft Windows [Version 10.0.19042.2251] C:\>
This command does not show version on Windows 7/Windows 10.
Also Read:
Complete list of Windows CMD commands
How to fix a Blue Screen of Death (BSOD)
The infamous blue screen of death usually shows up without any warning. It’s an important indicator of internal problems with hardware, software, or drivers. If Windows can no longer be run as a result of such a problem, then the forced shutdown takes place in the form of a blue screen containing an error message. This may cause unsaved files and documents to be lost. The most important thing with…
How to fix a Blue Screen of Death (BSOD)
lucadpShutterstock
CMD commands for the Windows command prompt
There are more than 200 CMD commands available with Windows. The command prompt can be used to control large parts of the operating system, computer, or drives. You can also use the Windows “command prompt” commands to organize your files or run network tasks. To do this, though, you have to know the right commands. Here we explain how to use CMD commands and which functions they have. Our article…
CMD commands for the Windows command prompt
REDPIXEL.PLShutterstock
Deleting Windows.old — How to
Windows offers a variety of features to ensure that the system functions over the long term. For example, the operating system generates a backup folder called Windows.old during new installations, upgrades or major updates which can be used to restore the system to its previous state. In our article, you will learn about the circumstances in which you can remove Windows.old and how to do so.
Deleting Windows.old — How to
G-Stock StudioShutterstock
How to find the computer name on Windows and Mac – here’s how
Whether due to technical problems or because various computers in a network have the same name: sometimes you need to know how to find a computer name to simplify the assignment of a computer to a network. Finding your computer name is usually a simple and quick process. Find out where you need to look to locate your computer name when using Windows 7, 8, and 10, or Mac.
How to find the computer name on Windows and Mac – here’s how
Perspective JetaShutterstock
What version of Microsoft Office do I have?
If you’re experiencing compatibility issues or error messages with Microsoft Office applications, it’s important to have the version number of the Office program you’re using to hand. Because the error messages you’re getting largely depend on the Office version you’re using. We’ll show you how to find out what version of Office you have in Word, Excel, PowerPoint, OneNote, or Outlook.
What version of Microsoft Office do I have?
But is there a way to get the exact version string using command line output similar to the one mentioned in the image?
The attached is the output of «winver» command from run. PS: I am looking for a batch or PowerShell command.
There are some alternates available to get the Windows version like this PowerShell command:
[System.Environment]::OSVersion
asked Mar 14, 2017 at 6:09
1
The ver
command shows something like this:
> ver
Microsoft Windows [Versión 10.0.17134.228]
But in PowerShell (or Git Bash) you have to call it through the cmd
command:
> cmd /c ver
answered Sep 1, 2018 at 16:27
Mariano DesanzeMariano Desanze
7,8877 gold badges46 silver badges68 bronze badges
2
The following commands are is going to help you with that. If you need more information, just type in systeminfo:
systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
wmic os get Caption,CSDVersion /value
answered Mar 14, 2017 at 6:19
shameer1101shameer1101
4743 silver badges5 bronze badges
5
I found it somewhere, PowerShell:
(Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").ReleaseId
answered Dec 19, 2017 at 0:56
knileknile
3183 silver badges15 bronze badges
3
To add to @Bonifacio ‘s answer:
REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" | findstr ReleaseId
Would be even better, because it returns only the ReleaseId value, which you could then pipe to a file. Especially useful if you have several hosts to deal with.
REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" | findstr ReleaseId > any_path\%COMPUTERNAME%_OS_Version.txt
answered Sep 18, 2019 at 19:06
2
With system information you can only get the build with that value and go to Google to get the respective version.
However, one simple way is by searching the registry on the command line:
REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" | findstr REG_SZ
answered Aug 8, 2018 at 15:33
1
The reg query way suggested all output a little garbage.
REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" | findstr ReleaseId
Output:
ReleaseId REG_SZ 2009
Using a for loop with tokens will output clean information.
for /f "tokens=3" %i in ('REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" ^| findstr ReleaseId') do echo %i
Output:
2009
The tokens=3
refers to the third word from the original output.
You will need to double the %
if running inside a bat file.
You can set the output as a variable by replacing echo %i
with set build=%i
Also remember to escape ^
any special characters.
Lastly look at HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion
for the string that has the required value. You may need to adjust the token count.
answered Nov 3, 2020 at 17:42
2
For what it is worth, I combined a few answers into this powershell function. (I tested this using pwsh 7.2.1).
<#
.SYNOPSIS
Gets information about the version of windows this session is running on.
.OUTPUTS
A hashtable with various key/value pairs containing version information.
.EXAMPLE
PS> $winver = Get-Winver
PS> $winver
Name Value
---- -----
DisplayVersion 21H2
ProductName Windows 10 Enterprise
CurrentBuildNumber 19044
KeyName HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows NT\CurrentVersion
Version 10.0.19044.0
VersionString Microsoft Windows NT 10.0.19044.0
OsVersion Microsoft Windows NT 10.0.19044.0
PS> $winver.Version
Major Minor Build Revision
----- ----- ----- --------
10 0 19044 0
#>
function Get-Winver {
$keyName = "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows NT\CurrentVersion"
$versionKey = (Get-Item $keyName)
$displayVersion = $versionKey.GetValue("DisplayVersion")
$productName = $versionKey.GetValue("ProductName")
$currentBuildNumber = $versionKey.GetValue("CurrentBuildNumber")
$osver = [System.Environment]::OSVersion
$winver = [Ordered]@{
"DisplayVersion" = $displayVersion
"ProductName" = $productName
"CurrentBuildNumber" = $currentBuildNumber
"KeyName" = $keyName
"Version" = $osver.Version
"VersionString" = $osver.VersionString
"OsVersion" = $osver
}
return $winver
}
answered Feb 17, 2022 at 1:23
PhilPhil
5,8622 gold badges31 silver badges61 bronze badges
1
In cmd you can use — ver
C:\Users\user_user>ver
Microsoft Windows [Version 10.0.19044.2130]
In PowerShell
from:
How to find the Windows version from the PowerShell command line
$Version = Get-ItemProperty -Path ‘HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion’
«Version $($Version.ReleaseId) (OS Build $($Version.CurrentBuildNumber).$($Version.UBR))»
answered Oct 19, 2022 at 8:32
2
Do you wonder how to find out what version of Windows is running?
The Windows version can be checked in multiple ways.
In this short note i am showing the easiest way to get information about the Windows version using the winver
command from the “Run” dialog or using the systeminfo
command from a command-line prompt (CMD) or from a PowerShell.
Cool Tip: How to find Windows product key from CMD & PowerShell! Read more →
To check your Windows version – press the ⊞ Win + R shortcut to open the “Run” dialog, type in winver
and click “OK”.
The winver
command launches the “About Windows” that displays the version of Windows that is running, the build number and what service packs are installed.
To find out your Windows version from a command-line prompt (CMD) or from a PowerShell, use the systeminfo
command:
C:\> systeminfo ... OS Name: Microsoft Windows 10 Pro OS Version: 10.0.19042 N/A Build 19042 OS Manufacturer: Microsoft Corporation OS Configuration: Standalone Workstation OS Build Type: Multiprocessor Free ...
Was it useful? Share this post with the world!
Самый простой способ быстро узнать версию и билд операционной системы Windows, установленной на компьютере – нажать сочетание клавиш
Win+R
и выполнить команду
winver
.
На скриншоте видно, что на компьютере установлена Windows 10 версия 22H2 (билд 19045.3324). Как номер релиза, так и номер сборки (билда) Windows позволяет однозначно идентифицироваться версию операционной системы на компьютере.
Также можно открыть окно с информацией о системе с помощью сочетания клавиш
Win+Pause
. Это откроет соответствующий раздел Settings (System -> About) или окно свойств системы (в зависимости от версии Windows).
Начиная с Windows 10 20H2, классическое окно свойств системы в Control Panel скрыто и не доступно для прямого запуска. Чтобы вызвать его, выполните команду
shell:::{bb06c0e4-d293-4f75-8a90-cb05b6477eee}
.
Можно получить информацию о билде и версии Windows, установленной на компьютере, из командной строки.
Выполните команду:
systeminfo
Можно отфильтровать вывод утилиты:
systeminfo | findstr /B /C:"OS Name" /B /C:"OS Version"
Или воспользуйтесь WMI командой:
wmic os get Caption, Version, BuildNumber, OSArchitecture
Аналогом команды systeminfo в PowerShell является командлет Get-ComputerInfo:
Get-ComputerInfo | select OsName, OsVersion, WindowsVersion, OsBuildNumber, OsArchitecture
Главный недостаток командлета Get-ComputerInfo – он выполняется довольно долго. Если вам нужно быстро узнать версию и билд Windows из скрипта PowerShell, лучше воспользоваться одной из следующий конструкций.
Версия Windows в переменной окружения:
[System.Environment]::OSVersion.Version
Из WMI класса:
Get-WmiObject -Class Win32_OperatingSystem | fl -Property Caption, Version, BuildNumber
В современных версиях PowerShell Core 7.x вместо командлета Get-WmiObject нужно использовать Get-CimInstance:
Get-CimInstance Win32_OperatingSystem | fl -Property Caption, Version, BuildNumber, OSArchitecture
Значение параметра OSArchitecture позволяет определить установлена ли на компьютере
x86
или
x64
версия Windows.
Можно получить номер билда и версии непосредственно из реестра Windows.
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
или
Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion"| select ProductName, DisplayVersion, CurrentBuild
С помощью параметров реестра
ProductVersion
,
TargetReleaseVersion
и
TargetReleaseVersionInfo
в ветке HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate вы можете указать версию Windows, до которой ваш компьютер может автоматически обновиться. Эти параметры позволяют также запретить автоматическое обновление ОС до Windows 11.
Вы можете получить информацию о версии Windows на удаленном компьютере через PowerShell Remoting:
Invoke-Command -ScriptBlock {Get-ItemProperty 'HKLM:SOFTWARE\Microsoft\Windows NT\CurrentVersion' | Select-Object ProductName, ReleaseID, CurrentBuild} -ComputerName wksPC01
Или WMI/CIM:
Get-ciminstance Win32_OperatingSystem -ComputerName wksPC01 | Select PSComputerName, Caption, OSArchitecture, Version, BuildNumber | FL
Если компьютер добавлен в домен Active Directory, вы можете получить информацию о версии/билде Windows на компьютере из атрибутов компьютера в AD (как получить список версий и билдов Windows в домене Active Directory).