Unfortunately the OSVersion info doesn't provide enough information especially when dealing with multiple build versions of Windows 10 in our environment, as some of our software doesn't work across all builds (usually because some features are only available on specific builds):
OS Versions: 7, 10, 2008 R2, 2012 R2, 2016, 2019
OS Editions: Home, Professional or Enterprise
OS Builds: 1709, 1803, 1809, 1903, 1909
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion can usually be used to determine most of this info, however WMI is generally more consistent when running across multiple OS versions.
Global $g_sOSCaption, $g_sOSVersion
_GetOSInfo()
ConsoleWrite("OS Caption : " & $g_sOSCaption & @CRLF & "OS Version : " & $g_sOSVersion & @CRLF)
Func _GetOSInfo()
Local $oSystemSet = ObjGet("winmgmts:").InstancesOf ("Win32_OperatingSystem")
If IsObj($oSystemSet) Then
For $oSystem In $oSystemSet
$g_sOSCaption = $oSystem.Caption
$g_sOSVersion = $oSystem.Version
Next
EndIf
EndFunc