If I'm in CMD I can use winver

enter image description here

I can see my OS version is 20H2 now. But this is GUI result, I want to use command line to make it. If I use

ver 

Microsoft Windows [版本 10.0.19042.868]

If I'm in powershell, I can use

Get-ComputerInfo WindowsVersion 
WindowsVersion -------------- 2009 

So how to get the version like "20H2" in command line(powershell or cmd)?

1 Answer

The value can be found under registry key Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion inside the value named DisplayVersion.

The following PowerShell command will get it:

(Get-Item "HKLM:SOFTWARE\Microsoft\Windows NT\CurrentVersion").GetValue('DisplayVersion') 
4

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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