Add "ReleaseID" (aka version or build) to ver output

Nov 6, 2014
25
0
The `winver` command opens a pop-up dialog that has the following information (among other things):

Code:
Microsoft Windows
Version 1903 (OS Build 18362.959)

The 1903 number is important since so much information on the internet will say something like "you need Win 10 1903 to get this feature". However there's no dead simple way to get that information on the command line (and even in the GUI I usually have to hunt around because I never remember from one time to 6 months later when I need it again).

I think it would be nice to add it to the ver command output. If there's a concern that it will break scripts, add a /v option or something. But I think it should just be part of the default output.

FWIW, this command will display the number:

Code:
for /f "tokens=3" %i in ('Reg Query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ReleaseId ^| find "ReleaseId"') do @echo/%i

What a nightmare - thanks, Microsoft. I'd prefer not to have to rely on an alias or whatever to get it - it should just be part of the ver output in my opinion.
 
May 20, 2008
10,675
83
Syracuse, NY, USA
I use this user-defined function.

Code:
winverex=%@word["|",0,%@wmi[.,"Select Name from Win32_OperatingSystem"]]^r^n%@wmi[.,"Select Version from Win32_OperatingSystem"].%@regquery["HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\UBR"] (%@regquery["HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ReleaseId"])

It produces this information.

Code:
v:\> echo %@winverex[]
Microsoft Windows 10 Pro for Workstations
10.0.18363.959 (1909)

I suppose I could also wrap it in an alias ... say VER=`echo %@winverex[]`