# List of win32 processes

**URL:** <https://www.ruby-forum.com/t/list-of-win32-processes/125340>\
**Category:** Ruby\
**Created:** [January 8, 2008, 12:40pm UTC](https://www.ruby-forum.com/t/list-of-win32-processes/125340 "2008-01-08T12:40:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Junkone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e274bd/32.png) [@Junkone](https://www.ruby-forum.com/u/Junkone)\
**Post date:** [January 8, 2008, 12:40pm UTC](https://www.ruby-forum.com/t/list-of-win32-processes/125340/1 "2008-01-08T12:40:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Junkone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e274bd/32.png) [@Junkone](https://www.ruby-forum.com/u/Junkone)\
**Post date:** [January 8, 2008, 1:46pm UTC](https://www.ruby-forum.com/t/list-of-win32-processes/125340/2 "2008-01-08T13:46:46Z")

</div>

On Jan 8, 12:36 pm, Junkone [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 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
