How to get the correct Windows version from command line

Viewed 60
1 Answers

You can retrieve it from the registry:

Get-ItemPropertyValue 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' DisplayVersion

Note:

  • Apparently only works in version 20H2 and above.
  • Prior to that, winver.exe (whose screenshot is shown in the question), apparently showed the ReleaseId registry value (in lieu of DisplayVersion above).
Related