I have this issue. Using just command "ver" in batch I get: Microsoft Windows [Version 10.0.18363.900]

I need the last sub-build version (900) for an script to determine if windows is on latest patch level (or close to it, after checking the main build version too) My script works perfect on windows 10, windows 2019 but not in windows 2016, since "ver" will print: Microsoft Windows [Version 10.0.14393]

Without the sub-build version. When checking "WinVer" will print on GUI: Version 1607 (OS Build 14393.3930)

So, in windows 2016 where I can get that "3930" from batch or powershell? WMI, sysinfo, etc wont show that.



It's called the Update Build Revision. Use the following command to query it:

Get-ItemPropertyValue 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion' 'UBR'  
  • Thank you so much, I searched registry by hand looking for it and I found it in several random places (like internet explorer version...) I cant believe that I missed the CurrentVersion Key.
    – DefToneR
    Sep 25 '20 at 12:43
  • Just adding that I ended up using batch, so to avoid converting the hex to dec (UBR is set in hex) I used "BuildLabEx" and parsed the result: for /f "tokens=3" %%a in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "BuildLabEx"') do set _Patch=%%a set _PatchClean=!_Patch:~6,4!
    – DefToneR
    Sep 25 '20 at 13:00
  • As an alternative, you could also parse out of (Get-ItemProperty -Path c:\windows\system32\hal.dll).VersionInfo.FileVersion
    – Dallas
    Oct 12 at 22:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.