' GetOSData.vbs ' -------------------------------------------------------' 'Option Explicit Dim objWMIService, objItem, colItems, strComputer, item strComputer = "." 'Run the query Set objWMIService = GetObject("winmgmts://" & strComputer & "/root/cimv2") Set colItems = objWMIService.ExecQuery ("Select * from Win32_OperatingSystem") dim strValues strValues = "Version: " For Each objItem in colItems For Each item in objItem.Properties_ if typename(item.value) = "Variant()" then wscript.echo item.name + " is null or a variant" else strValues = strValues + item.Name & ": " & item.Value & vbCrLf end if Next Next WScript.Echo strValues WScript.Quit