On Error Resume Next
' Connect to WMI and obtain instances of Win32_OperatingSystem
For Each objOS in GetObject("winmgmts:").InstancesOf ("Win32_OperatingSystem")
WScript.Echo "Version = " & objOS.Version
Next
if Err <> 0 Then
WScript.Echo Err.Description
Err.Clear
End If