42

How do I get the version number for Windows 10 [1903], instead of the build number [10.0.18362.592], via command line?

JW0914
  • 7,052
  • 7
  • 27
  • 48
Jacob
  • 453
  • 1
  • 4
  • 3
  • 1
    1903 is built number itself, the lates version number of windows <19 for sure – Navruzbek Noraliev Jan 23 '20 at 14:16
  • 3
    The big problem with this seems to be the inconsistency with the naming of the build numbers and the version numbers. What some refer to as the build number other's refer to as the version number and vice-versa – SpacePhoenix Jan 23 '20 at 19:42
  • @SpacePhoenix that seems to be a matter of perspective. When you navigate to Start > Run and enter *winver*, it very clearly shows you the **Version** as well as the **OS Build** number. As a result, the "big problem" really seems to be customer education. – Run5k Jan 25 '20 at 15:50
  • 3
    There are _two_ commands, see the difference: `ver` vs. `winver`. – JosefZ Jan 25 '20 at 20:11
  • 2
    Does this answer your question? [How to find the build / version of Windows 10](https://superuser.com/questions/963910/how-to-find-the-build-version-of-windows-10) – JosefZ Jan 25 '20 at 20:11
  • @Run5k if you use *ver* it shows the build number as the version number – SpacePhoenix Jan 25 '20 at 22:11
  • Note that `10.0.18362.592` actually _is_ the version you are running - `1903` is a marketing name. (Yes, I understand why you want to see the latter, not the former) – Aganju Mar 06 '20 at 16:16

7 Answers7

52

How do I get the version, such as 1903, instead of the "build number"?

The following PowerShell command will provide the information you are seeking:
(Source: How to get Windows version from the command prompt or PowerShell)

  • (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion').ReleaseId
    
  • Registry query from the command prompt:
    Reg Query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" | findstr ReleaseId
    

I have no words for this. I've been spending a ridiculous amount of time searching and searching and searching a million times, and every single webpage on the Internet keeps telling me about the worthless ver command or wmic blabla, which does not give you the version number.

I must point out the version of Windows you are using is actually the Build version (i.e. 18363), instead of ReleaseID (i.e. 1909).

  • You would use [System.Environment]::OSVersion.Version to tell the difference between Windows 7 Service Pack 1 and Windows 7 RTM.
Ramhound
  • 41,734
  • 35
  • 103
  • 130
27
Reg Query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ReleaseId

Screenshot

JW0914
  • 7,052
  • 7
  • 27
  • 48
SQLTemp
  • 1,452
  • 2
  • 10
  • 22
20

Powershell

Get-ComputerInfo -Property "WindowsVersion"

Powershell Get-ComputerInfo output

Picture 1: Above the whole output of the Get-ComputerInfo powershell invocation, without options.

Some words more

The Microsoft Windows operating system was first labelled with standard version numbers from 1 to 3.11 (read the full chapter [w])... then after some leaps and many years, in windows 10 the subsequent OS updates only incremented the build number and update build revision (UBR) number (see below).

In windows 10 the version number requested by the OP is based on the date of the most recent large build release and uses a YYMM format [2]. This version number is the one we can find e.g. via Settings panel, then System > About and we can read the Version (Shortcut Windows+I) and gives a prompter information about the OS update state.

Version[2] The version number gives you the best information on what version of Windows 10 you’re running. The number is based on the date of the most recent large build release and uses a YYMM format. For example, in the screenshot above, the “1607” version tells us that the version we’re running is from the 7th month (July) of 2016.

BTW from the command prompt you can directly ask to open winver and read the version number from the second line [3]...

winver

systeminfo

In systeminfo it is available the OS version (the one with the built number, e.g 10.0.18362) that you may compare with a list similar to the above one, and the Original Install Date. I don't know if for each major upgrade the Original Install Date value is updated (Remember that YYMM gives that number). At least as minimum you can reconstruct the first installed version on your machine.

A List [4,R]

Windows 10 (1903)       10.0.18362
Windows 10 (1809)       10.0.17763
Windows 10 (1803)       10.0.17134
Windows 10 (1709)       10.0.16299
Windows 10 (1703)       10.0.15063
Windows 10 (1607)       10.0.14393
Windows 10 (1511)       10.0.10586
Windows 10              10.0.10240  

Windows 8.1 (Update 1)  6.3.9600
Windows 8.1             6.3.9200
Windows 8               6.2.9200

Windows 7 SP1           6.1.7601
Windows 7               6.1.7600

Windows Vista SP2       6.0.6002
Windows Vista SP1       6.0.6001
Windows Vista           6.0.6000

Windows XP2             5.1.26003

You can read an updated version of the list on wikipedia page [R].

Hastur
  • 18,764
  • 9
  • 52
  • 95
  • If you're wanting just the number (say for displaying on a GUI) you can use `(Get-ComputerInfo).WindowsVersion` in PowerShell instead of using the `property` tag. Then you don't get the table format, either. But thanks, this is the solution I was looking for a couple weeks ago! – KGlasier Jan 24 '20 at 20:38
  • @KGlasier or just `Get-ComputerInfo WindowsVersion` – SimonS Mar 06 '20 at 15:06
10

Some options in PowerShell:

  • (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion').ReleaseId
    
    or
    (Get-ComputerInfo).WindowsVersion
    

  • With alias:
    (gp 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion').ReleaseId
    
    or
    (gin).WindowsVersion
    

  • Save output in clipboard (ctrl+C)
    (gp 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion').ReleaseId | clip
    
    or
    (gin).WindowsVersion | clip
    


  • Actual Version output only: (returns 1903)
    for /f tokens^=^3 %i in ('Reg Query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ReleaseId')do
      echo/%i|clip
    

  • For add/set var in command line and send to output and clipboard (ctrl+C)
    for /f tokens^=^3 %i in ('Reg Query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ReleaseId')do
      echo/%i && set "_bildernumber=%i"
      echo %_bildernumber%|clip
    

  • For add/set var in cmd/bat file and send output to clipboard (ctrl+C)
    @echo off
    
    for /f tokens^=^3 %%i in ('Reg Query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ReleaseId')do
      echo/%%i && set "_bildernumber=%%i"
      echo %_bildernumber%|clip
    
    or
    @echo off
    
    for /f tokens^=^3 %%i in ('Reg Query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ReleaseId')do
      echo/%%i && set "_bildernumber=%%i"
      echo %_bildernumber%|clip
    
JW0914
  • 7,052
  • 7
  • 27
  • 48
Io-oI
  • 7,588
  • 3
  • 12
  • 41
5

You could try winver, which provides a pop-up window showing Version, Build and/or Service Pack numbers.

JW0914
  • 7,052
  • 7
  • 27
  • 48
iWumbo
  • 59
  • 2
  • 3
    This works perfectly. – spemble Jan 23 '20 at 14:00
  • 5
    It is not clear by the current revision of the question but this is not actually want the author wanted. They wanted an output within the command and/or PowerShell prompt. There have been more than 3 answers deleted due this fact. While this detail was removed from the body for several reasons, the title of this question, makes the author's specific requirements clear. – Ramhound Jan 23 '20 at 14:38
1

Cygwin:

Reg Query 'HKLM\Software\Microsoft\Windows NT\CurrentVersion' |grep ReleaseId |sed -E 's/.* ([^ ]+)/\1/'
  • reg query is similar to other answers
  • grep ReleaseId finds the line with the Release ID
  • By using the sed -E 's/.* ([^ ]+)/\1/' POSIX regular expression syntax, -E matches any characters followed by a space, then captures a group of one or more non-space characters. This will get the last field on the line (without -E it would require backslash escaping the parentheses and the plus sign) and substitute that captured group of non-space characters, which is the value we're looking for.
JW0914
  • 7,052
  • 7
  • 27
  • 48
David Conrad
  • 111
  • 3
1

I've done lots of searching and came along this post, for what you're looking for this is the simplest answer Get-ComputerInfo | select windowsversion

Onluck
  • 19
  • 5