How to Get the Windows Version with Command Line?
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 Ver Microsoft...
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
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')