Option Explicit
Dim objWMI, objItem, colItems
Dim strComputer, VerOS, VerBig, Ver9x, Version9x, OS, OSystem
On Error Resume NExt
strComputer = "."
' This is where WMI interrogates the operating system
Set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMI.ExecQuery("Select * from Win32_OperatingSystem",,48)
' Here we filter Version from the dozens of properties
For Each objItem in colItems
VerBig = Left(objItem.Version,3)
Next
'5.0 = W2K
'5.1 = XP
'5.2 = Windows 2003
'4.0 = NT 4.0
Msgbox(VerBig)
On Error Goto 0
WScript.Quit