'EXIT CODES RETURNED ' '(1) 'Server 2003 x86 No Citrix '(2) 'Server 2003 x64 No Citrix '(3) 'Server 2008 Std x86 No Citrix '(4) 'Server 2008 Std x64 No Citrix '(5) 'Server 2008 R2 x86 No Citrix '(6) 'Server 2008 R2 x64 No Citrix '(10) 'Server 2003 x86 with Citrix '(11) 'Server 2003 x64 with Citrix '(12) 'Server 2008 Std x86 with Citrix '(13) 'Server 2008 Std x64 with Citrix '(14) 'Server 2008 R2 x86 with Citrix '(15) 'Server 2008 R2 x64 with Citrix '(20) 'XP 32 bit ON ERROR RESUME NEXT strComputer = "." dim osname, osver, procbit, build, ProdType, majorversion, minorversion, citrix Set Wmi = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") Set colItemsOS = Wmi.ExecQuery("SELECT * FROM Win32_OperatingSystem",,48) Set colItemsProc = Wmi.ExecQuery("SELECT * FROM Win32_Processor", "WQL", wbemFlagReturnImmediately + wbemFlagForwardOnly) For Each objItem in colItemsOS osname = objItem.Caption osver = objItem.Version build = objItem.BuildNumber ProdType = objItem.ProductType Next For Each objItem in colItemsProc procbit = objItem.AddressWidth Next dim lngpos1, lngPos2 lngPos1 = instr(osver, ".") lngPos2 = instr(lngPos1 + 1,osver, ".") majorVersion = left(osver, lngpos1 - 1) if lngPos2 = 0 then minorVersion = mid(osver, lngpos1 + 1) else minorVersion = mid(osver, lngpos1 + 1, len(osver) - lngpos2 - (lngpos1 + 1)) end if Set tstWMInamespace = GetObject("winmgmts:\\" & strComputer & "\Root\Citrix") if ERR <> 0 then citrix = 0 elseif ERR = 0 then citrix = 1 end if wscript.echo "Os Name: " & CStr(osname) wscript.echo "OS Ver: " & osver wscript.echo "Poc Bit: " & procbit wscript.echo "Build #: " & build wscript.echo "Major: " & majorversion wscript.echo "Minor: " & minorversion wscript.echo "Product Type: " & ProdType wscript.echo "Citrix: " & citrix if majorversion="5" and minorversion="2" and procbit = "32" and ProdType = "3" and citrix = "0" then wscript.quit(1) 'Server 2003 x86 No Citrix if majorversion="5" and minorversion="2" and procbit = "64" and ProdType = "3" and citrix = "0" then wscript.quit(2) 'Server 2003 x64 No Citrix if majorversion="6" and minorversion="0" and procbit = "32" and ProdType = "3" and citrix = "0" then wscript.quit(3) 'Server 2008 Std x86 No Citrix if majorversion="6" and minorversion="0" and procbit = "64" and ProdType = "3" and citrix = "0" then wscript.quit(4) 'Server 2008 Std x64 No Citrix if majorversion="6" and minorversion="1" and procbit = "32" and ProdType = "3" and citrix = "0" then wscript.quit(5) 'Server 2008 R2 x86 No Citrix if majorversion="6" and minorversion="1" and procbit = "64" and ProdType = "3" and citrix = "0" then wscript.quit(6) 'Server 2008 R2 x64 No Citrix if majorversion="5" and minorversion="2" and procbit = "32" and ProdType = "3" and citrix = "1" then wscript.quit(10) 'Server 2003 x86 with Citrix if majorversion="5" and minorversion="2" and procbit = "64" and ProdType = "3" and citrix = "1" then wscript.quit(11) 'Server 2003 x64 with Citrix if majorversion="6" and minorversion="0" and procbit = "32" and ProdType = "3" and citrix = "1" then wscript.quit(12) 'Server 2008 Std x86 with Citrix if majorversion="6" and minorversion="0" and procbit = "64" and ProdType = "3" and citrix = "1" then wscript.quit(13) 'Server 2008 Std x64 with Citrix if majorversion="6" and minorversion="1" and procbit = "32" and ProdType = "3" and citrix = "1" then wscript.quit(14) 'Server 2008 R2 x86 with Citrix if majorversion="6" and minorversion="1" and procbit = "64" and ProdType = "3" and citrix = "1" then wscript.quit(15) 'Server 2008 R2 x64 with Citrix if majorversion="5" and minorversion="1" and procbit="32" then wscript.quit(20) 'XP 32 bit wscript.quit(999)