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)?

DisplayVersionwas the only value in my registry that contained the string20H2, so without it one needs manually to map the numeric value ofReleaseIdto a name. – harrymc Apr 08 '21 at 14:54Version 2004toVersion 20H2with the release of 20H2. It appears thatReleaseIdis still the YYMM date format. – Ramhound Apr 08 '21 at 15:03