list of win32 processes

J

Junkone

I need to get list of processes running on windows with process names
and pids. is there any api that will do it. i was looking at win32/
process and could not fidn a function that will provide list of
existing running processes.
 
L

Lars

I need to get list of processes running on windows with process names
and pids. is there any api that will do it. i was looking at win32/
process and could not fidn a function that will provide list of
existing running processes.

Try sys/proctable:

irb(main):002:0> require 'sys/proctable'
=> false
irb(main):002:0> require 'time' # dependency of sys/proctable
=> false
irb(main):003:0> Sys::procTable.ps.find { |p| p.name ==
"ruby.exe" }.pid
=> 600


Lars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top