Over a million developers have joined DZone.

Using Ruby & WMI To Get Win32 Process Information

From the Ruby on Windows blog...

Use Windows Management Instrumentation (WMI) to get information about the Win32 processes being run.

require 'win32ole'

wmi = WIN32OLE.connect("winmgmts://")

processes = wmi.ExecQuery("select * from win32_process")

for process in processes do
    puts "Name: #{process.Name}"
    puts "CommandLine: #{process.CommandLine}"
    puts "CreationDate: #{process.CreationDate}"
    puts "WorkingSetSize: #{process.WorkingSetSize}"

Further details and discussion here.


{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}