Option Explicit Sub CheckOSVersion Const HKEY_LOCAL_MACHINE = &H80000002 Dim WshShell,objRegistry Dim strComputer, strKeyPath, strValue, strValueName Set WshShell = CreateObject("WScript.Shell") strComputer = "." Set objRegistry = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv") strKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion" strValueName = "CurrentMajorVersionNumber" objRegistry.GetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue If (not IsNull(strValue)) and (strValue=10) Then Session.Property("IsWindows10")="1" else Session.Property("IsWindows10")="0" End If End Sub