Comment get the version, such as 1903, instead of the "build number"?
The following PowerShell command will provide the information you are seeking:
(Source: Comment get Windows version from the invite de commandes or PowerShell)
-
`(Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion').ReleaseId
- Registry query from the command prompt:
`Reg Query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" | findstr ReleaseId
J'ai no words for this. I've been spending a ridiculous amount of time searching and searching and searching a million times, and every single webpage on the Internet keeps telling me about the worthless ver command or wmic blabla, which does not give you the version number.
I must point out the version of Windows you are using is actually the Build version (i.e. 18363), instead of ReleaseID (i.e. 1909).
- You would use
[System.Environment]::OSVersion.Version to tell the difference between Windows 7 Service Pack 1 and Windows 7 RTM.