Option Explicit
Dim Act, Fso, ColItems, ObjItem, SvcVer, OSVer, Wmi
  Set Act = CreateObject("Wscript.Shell")
  Set Fso = CreateObject("Scripting.FileSystemObject")
  Set Wmi = GetObject("winmgmts:\\.\root\CIMV2") 
  Set ColItems = Wmi.ExecQuery("SELECT * FROM Win32_OperatingSystem",,48) 
        For Each ObjItem in ColItems
        SvcVer = ObjItem.ServicePackMajorVersion
		OSVer = ObjItem.Version
		 If InStr(OSVer, "5.1") = 1 Then
			 If SvcVer = 1 Then WScript.Quit 1 
			 If SvcVer = 2 Then WScript.Quit 2 
			 If SvcVer = 3 Then WScript.Quit 3 
			 If SvcVer = 4 Then WScript.Quit 4 
		 Else
		 	WScript.Quit 4
		 End If
        Next