Slayther Slayther - 2 months ago 5x
Python Question

Get windows 10 build version (release ID)

I want to get Windows build version. I have searched everywhere for this, but to no avail.

No, I don't want to know if it's 7, 8, 10, or whatever. I don't want the Windows build number. I want to know the Windows build version. I am not sure what the official name of this would be, but here is an image of what I'm asking for:

enter image description here

I tried using the

modules, but I can't seem to find anything built-in that can do this.


It seems you are looking for the ReleaseID which is different from the build number.

You can find it by query the value of ReleaseID in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion registry key:

import os
def getReleaseId():
    key = r"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion"
    val = r"ReleaseID"
    output = os.popen( 'REG QUERY "{0}" /V "{1}"'.format( key , val)  ).read()
    return int( output.strip().split(' ')[-1] )