From: David F. <fr...@ll...> - 2003-10-24 19:36:47
|
Has anyone attempted to query Microsoft's WMI service from within Tcl? I am attempting to use Tcom to perform this function but am having trouble getting my script to return anything useful. Here is what I have done thus far (this query should return a collection of all hotfixes installed on the machine): package require tcom set oWmiSvc [::tcom::ref getobject "winmgmts:{impersonationLevel=impersonate}!\\\\.\\root\\cimv2"] set colHotFixes [$oWmiSvc ExecQuery "SELECT * FROM WIN32_from Win32_QuickFixEngineering"] puts $colHotFixes the puts command returns: ::tcom::handle0x00CCECA0 I want to get a list containing the HotFixID property of each HotFix installed. I can do this in VbScript, as follows: vComp = "." Set oWmiSvc = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & vComp & "\root\cimv2") logit "Retreiving patch list from WMI..." Set colPatches = oWmiSvc.ExecQuery("Select * from Win32_QuickFixEngineering") For Each oPatch in colPatches vPatchID = oPatch.HotFixID Next Anyone have any ideas? |