--- In [email protected], "quantiworks" <quanticwo...@...> wrote:
>
> "Sheri" wrote:
>
> > See if the com plugin's comPluginTestScriptWMI.powerpro works under LUA. No
> > guarantee it would also work for querying workingset size but this would be
> > the likely direction of a solution.
>
> test script works well, console status messages returned all -OK
>
This works for me (but Yahoo will break some lines):
local com_status, com_type
local objWMIService, sStatus
com.error_dialog_off()
com.returns_values()
local strComputer = "."
local sWMIservice = ?"winmgmts:{impersonationLevel=Impersonate}!\\" ++
strComputer ++ ?"\root\cimv2"
objWMIService = com.get_object(sWMIservice)
local colProcessMem = com.method(objWMIService, "ExecQuery", ;;+
"SELECT name, processid, workingsetsize from Win32_Process where
name=\x22firefox.exe\x22")
local objProcessEnum = com.get_enumerator(colProcessMem)
for (local i = 0; i < 2000 ; i = i + 1 )
local Processinfo = com.enumerator_next(objProcessEnum)
if (com_type eq "done")
break;
if ( index(com_status, "DONE") GT 0)
break;
win.debug(" " ++ com.get_property(ProcessInfo, "Name") ++ " "++
com.get_property(ProcessInfo, "ProcessId")++" " ;;+
++(com.get_property(ProcessInfo, "WorkingSetSize")/1024))
ProcessInfo = com.release(Processinfo)
endfor
objProcessEnum = com.release(objProcessEnum)
objWMIService = com.release(objWMIService)
colProcessMem = com.release(colProcessMem)
;wait.for(200)
;com.unload