Search code examples
pythonwindows-10windows-server

How to get the 'Release ID' of a windows server?


I am unable to find the release id(build version, looks like '1511' or '1803') of a windows server 2012 R2 Standard i need it for forming its CPE (common platform enumeration).

Being unfamiliar with all of this and getting to no such success i am not sure what to try either. For getting this release id on windows ten i used REG Query and to execute that automatically i used python with subprocess.

This is the command i used to obtain the release id:

'Reg Query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ReleaseId'

It successfully gave me the desired result for windows 10 but for windows server it gives:

ERROR: The system was unable to find the specified registry key or value.

Solution

  • I believe Release Id (aka Windows 10 Release Id, in YYMM format) if only available for Win 10 and Windows Server 2016 or higher.

    Maybe base your naming on Major / build version number?

    A table of all versions: