If I'm in CMD I can use winver
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
verMicrosoft Windows [版本 10.0.19042.868]
If I'm in powershell, I can use
Get-ComputerInfo WindowsVersionWindowsVersion -------------- 2009
So how to get the version like "20H2" in command line(powershell or cmd)?
1 Answer
The value can be found under registry keyComputer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersioninside the value named DisplayVersion.
The following PowerShell command will get it:
(Get-Item "HKLM:SOFTWARE\Microsoft\Windows NT\CurrentVersion").GetValue('DisplayVersion') 4