Windows command to check windows version

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.

  1. Systeminfo command – Windows OS name, version, edition and build number
  2. WMIC command – OS name and version
  3. Ver 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.

Finding version on Windows 7 system

Also Read:

Complete list of Windows CMD commands

How to fix a Blue Screen of Death (BSOD)

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)

CMD commands for the Windows command promptlucadpShutterstock

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

Deleting Windows.old - How toREDPIXEL.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

How to find the computer name on Windows and Mac – here’s howG-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

What version of Microsoft Office do I have?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?

Самый простой способ быстро узнать версию и билд операционной системы Windows, установленной на компьютере – нажать сочетание клавиш
Win+R
и выполнить команду
winver
.

На скриншоте видно, что на компьютере установлена Windows 10 версия 22H2 (билд 19045.3324). Как номер релиза, так и номер сборки (билда) Windows позволяет однозначно идентифицироваться версию операционной системы на компьютере.

winver - окно с версией и биодом Windows

Также можно открыть окно с информацией о системе с помощью сочетания клавиш
Win+Pause
. Это откроет соответствующий раздел Settings (System -> About) или окно свойств системы (в зависимости от версии Windows).

Информация о версии Windows в панели Settings -> About

Начиная с 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 - вывести версию windows

Аналогом команды systeminfo в PowerShell является командлет Get-ComputerInfo:

Get-ComputerInfo | select OsName, OsVersion, WindowsVersion, OsBuildNumber, OsArchitecture

Get-ComputerInfo

Главный недостаток командлета 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

Get-CimInstance Win32_OperatingSystem - узнать номер билда windows

Значение параметра 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

версия и билд Windows в реестре

С помощью параметров реестра
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).

Windows version.

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

Peter Mortensen's user avatar

asked Mar 14, 2017 at 6:09

Sandie's user avatar

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 Desanze's user avatar

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

Peter Mortensen's user avatar

answered Mar 14, 2017 at 6:19

shameer1101's user avatar

shameer1101shameer1101

4743 silver badges5 bronze badges

5

I found it somewhere, PowerShell:

(Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").ReleaseId

Peter Mortensen's user avatar

answered Dec 19, 2017 at 0:56

knile's user avatar

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

acadie_man's user avatar

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

Peter Mortensen's user avatar

answered Aug 8, 2018 at 15:33

Bonifacio's user avatar

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

fritolays's user avatar

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

Phil's user avatar

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

New_Kid's user avatar

2

If you’re curious about what your Windows operating system is, there are two ways to find out. First, you can use the Systeminfo command, which displays the system’s operating system version and service pack version. Using the ver command will not reveal the service pack version. In order to check your Windows version, you must know the exact build number of your computer. To do this, simply use the Windows Key + R combination to open the Run dialog box.

The second way is to type ‘winver’ into the Command Prompt. After entering the command, you’ll see a few lines of data. The first line of data shows what Windows version you have. The second line shows the version of your BIOS. It also displays the processor architecture of your computer. Once you know the version of your Windows, you can install new software and programs. You can also use this command to see if your computer has the latest version of Windows.

How Do I Check Windows Version in Cmd?

If you want to know what version of Windows your computer is running, you can use the command line. This command can be found in a variety of places, such as the Control Panel. The Control Panel displays the platform capabilities, type of operating system, memory available, and other details. It can also tell you the system name and network domain settings. Once you know what version of Windows you are running, you can continue using your computer.

To find the version of your operating system, use the systeminfo command. This command will list out the name and build number of your operating system. You can also use the ver command to find the Windows version. This command will also list any service packs or editions of Windows. It is essential to run the command in the right context because it may be different from the one you want. It’s important to note that these two commands are only compatible with Windows 10 and later.

What is the Command For Version?

The command ver is used to check the version of Windows OS on your computer. But, unlike SystemInfo, this command does not give you the name of the operating system or the number of service packs it is installed with. SystemInfo displays detailed configuration and hardware properties of your computer. By typing this command in the Command Prompt, you can easily find out whether your computer is running the latest version of the operating system or an older one.

If the “Run” command is not available, you can still open the “About Windows” page and type “winver” into the Run dialog. This will open a new window, and the version of Windows will be displayed. You will need to check the “build” number as well, if you have installed one. This will show you whether your system is running a 32-bit or a 64-bit version.

What is the Cmd Window?

There are two ways to find out what version of Windows your computer is running. The first way is to type “systeminfo” in the Command Prompt. You will get a message that shows which Windows version your computer has. The second way is to type “dsmg” and hit enter. If you need to see the details of a particular version, you will need to type the full name of the operating system, such as “Windows 10” or “Windows 8.”

The ver command lists the operating system version. Note that it does not tell you what service packs are installed. The systeminfo command displays detailed information about a computer’s hardware and software properties. This command is useful for determining what hardware is installed on a computer. However, the ver command doesn’t give you the operating system’s build number or service pack version. For this, you must use the “systeminfo” command.

What is My Operating System?

What is My Operating System? is a popular question, but where can you find out if your computer runs one? To learn which version of the OS is currently running on your PC, you can visit the About Your PC window on your computer’s start menu. There, you’ll find out whether your computer runs 32 or 64-bit versions of Windows. The 64-bit operating system will appear as 64-bit Operating System in the About Your PC window.

The operating system, or OS, is a collection of programs that manage the hardware and software on your computer. It serves as the interface between man and machine, managing memory and software and facilitating communication between the computer and other hardware. The most popular operating systems are Apple macOS, Microsoft Windows, Linux, Android, and Apple’s iOS. For more information, check out this video and learn how to find out what’s on your computer.

How Do I Find the Version of Windows PowerShell?

If you want to find the version of Windows PowerShell, you can do so in one of two ways. You can either use the command prompt or use tools to read the registry. Either way, the version won’t change, locally or remotely. However, if you’re not on a Windows 10 machine, you can use the command line method instead. To find the version of Windows PowerShell, type “cmd /ver” in the command prompt.

You will need the version number of Windows PowerShell in order to run certain commands. In PowerShell 5.1, the version number was 5.0. It introduced new features like search and pipeline operators. It also improved compatibility with other built-in modules. In Windows 10 and Windows Server 2012 R2, PowerShell is available in the Microsoft Store, which includes free PowerShell packages.

If you need to find the version of Windows PowerShell on a remote machine, you can use the registry. The registry is an excellent place to find the version number. You can also use the Get-ItemProperty cmdlet to find the path to the PowerShell engine. This cmdlet works with Windows 8, Windows Server 2012, and Windows 7, and older versions as well.

How Do I Check Software Version in Terminal?

How to check software version in terminal? A terminal is a command-line interface on a computer. To open a terminal, you should either use the Spotlight shortcut or the command () – Spacebar. Type “terminal” into Spotlight and then press the Return key. The version of macOS will be displayed in the format of “11 followed by numbers” such as 11.0.1. You can also open System Software Overview and look for the System Version in the list.

If you are not sure which operating system you’re running, you can type getconf -a and bootinfo -K to find out. You might find mentions of 64-bit in the /usr/lib/boot/unix* folder. You can also open a release file and check for the version by looking at its output. The name of the operating system, major and minor release version, and other specifications will be shown.

What Does C Do in Cmd?

A computer user may ask, “What does C do in Cmd?”. In general, CMD runs commands and allows users to view or modify files. CMD can produce both ANSI and UNICODE characters. Both of these types of file formats are commonly used in text files. When a user types a command, a shell window appears, ready to execute the command. In addition to command-line arguments, C-executable programs can also produce a file.

The C programming language supports the use of command line arguments to reduce the size of the code. Command line arguments are specified after the program name in the system’s command line and are passed to the program during execution. A typical C program will return a value if the arguments were successfully passed. In most cases, a command-line argument is passed by default to a program, but this is not always the case.

Learn More Here:

1.) Windows Help Center

2.) Windows – Wikipedia

3.) Windows Blog

4.) Windows Central

  • Windows command to add to path
  • Windows command prompt commands windows 10
  • Windows command prompt что это
  • Windows command processor что это
  • Windows command not recognized as an internal or external command