in the help file on Process Functions the second example throws an error "Error: 0x80020011 - Does not support a collection."
Specifically: _NewEnum
Line#
004: Gui := GuiCreate(, "Process List")
005: LV := Gui.Add("ListView", "x2 y0 w400 h500", "Process Name|Command Line")
---> 006: For process in ComObjGet("winmgmts:").ExecQuery("Select * from Win32_Process")
007: LV.Add("", process.Name, process.CommandLine)
008: Gui.Show()
Code: Select all
; throws error
Gui := GuiCreate(, "Process List")
LV := Gui.Add("ListView", "x2 y0 w400 h500", "Process Name|Command Line")
for process in ComObjGet("winmgmts:").ExecQuery("Select * from Win32_Process")
LV.Add("", process.Name, process.CommandLine)
Gui.Show
Code: Select all
; works
Gui := GuiCreate(, "Process List")
LV := Gui.Add("ListView", "x2 y0 w400 h500", "Process Name|Command Line")
for process in ComObjGet("winmgmts:").ExecQuery("Select * from Win32_Process")._NewEnum()
LV.Add("", process.Name, process.CommandLine)
Gui.Show