list of win32 processes

Discussion in 'Ruby' started by Junkone, Jan 8, 2008.

  1. Junkone

    Junkone Guest

    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.
     
    Junkone, Jan 8, 2008
    #1
    1. Advertising

  2. Junkone

    Lars Guest

    On Jan 8, 12:36 pm, Junkone <> 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
     
    Lars, Jan 8, 2008
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Filipe Bonjour

    Listing processes using Perl (Win32)

    Filipe Bonjour, Jul 26, 2003, in forum: Perl
    Replies:
    0
    Views:
    1,243
    Filipe Bonjour
    Jul 26, 2003
  2. Scaramouche

    processes in win32

    Scaramouche, Jan 16, 2004, in forum: Perl
    Replies:
    4
    Views:
    2,380
    Scaramouche
    Jan 21, 2004
  3. Jeff Rodriguez
    Replies:
    23
    Views:
    1,199
    David Schwartz
    Dec 9, 2003
  4. Marc Heiler
    Replies:
    1
    Views:
    189
    Robert Klemme
    May 24, 2009
  5. Francis Libble

    List Running Applications on Win32 (!Processes)

    Francis Libble, Feb 17, 2004, in forum: Perl Misc
    Replies:
    3
    Views:
    364
    Petri
    Feb 18, 2004
Loading...

Share This Page