From: Reggie Mr Date: 2006-06-13T15:41:55+09:00 Subject: Re: Getting a list of Processes Pe単a, Botp wrote: > fr Brad: > # Sure, no problem... also, you can list more than the process name. I > # like to show the PID and the executablepath, etc. Here are > # other process > # items you might like to examine: > # > # class Win32_Process : CIM_Process > # { > # string Caption; > # string CommandLine; > # ... > > it would be nice if a particular ruby win32ole method can expose all > those attributes without looking thru msdn docs, no? similar to an ole > browser yet in ruby lib format.. > Here it is...I think this is what you were looking for. It displays all of the properties for a WMI Class. require 'win32ole' class MyClass def get_process_info() procs = WIN32OLE.connect("winmgmts:\\\\.") rst = procs.ExecQuery("SELECT * FROM meta_class WHERE __class = 'Win32_Process'") rst.each do |x| puts x.path_.Class.to_s #The Class Name x.properties_.each do |m| puts " " + m.Name.to_s #Available Properties of this Class end end end end a = MyClass.new a.get_process_info() -- Posted via http://www.ruby-forum.com/.