processes in win32

Discussion in 'Perl' started by Scaramouche, Jan 16, 2004.

  1. Scaramouche

    Scaramouche Guest

    is there an equivalent to unixs' ps command in perl?
    i was writing some win32 scripts and i needed a listing of specific
    processes. i could perhaps grep through a list of running processes but how
    can i attain that through perl?

    thanks
     
    Scaramouche, Jan 16, 2004
    #1
    1. Advertising

  2. "Scaramouche" <> wrote in message news:<Q0HNb.22543$>...
    > is there an equivalent to unixs' ps command in perl?
    > i was writing some win32 scripts and i needed a listing of specific
    > processes. i could perhaps grep through a list of running processes but how
    > can i attain that through perl?
    >
    > thanks


    I believe Win32::process::Info will help you. For example,

    use Win32::process::Info;
    my $pi = Win32::process::Info->new();
    my @info = $pi->GetProcInfo();
    for my $pid (@info){
    print $pid->{"Name"}."\n";
    }
     
    Tomofumi Kitano, Jan 18, 2004
    #2
    1. Advertising

  3. Scaramouche

    Scaramouche Guest

    thank you for your help.

    this is returning an error though,
    "Can't locate Win32/Process/Info.pm in @INC (@INC contains: C:/Perl/lib
    C:/Perl/site/lib .) at E:\pscripts\proc.pl line 2. BEGIN failed--compilation
    aborted at E:\pscripts\proc.pl line 2".

    currently using activestate's v5.6.1 built for MSWin32-x86-multi-thread.
    will look into it further.

    once again, thank you for your help..


    "Tomofumi Kitano" <> wrote in message
    news:...
    > "Scaramouche" <> wrote in message

    news:<Q0HNb.22543$>...
    > > is there an equivalent to unixs' ps command in perl?
    > > i was writing some win32 scripts and i needed a listing of specific
    > > processes. i could perhaps grep through a list of running processes but

    how
    > > can i attain that through perl?
    > >
    > > thanks

    >
    > I believe Win32::process::Info will help you. For example,
    >
    > use Win32::process::Info;
    > my $pi = Win32::process::Info->new();
    > my @info = $pi->GetProcInfo();
    > for my $pid (@info){
    > print $pid->{"Name"}."\n";
    > }
    >
     
    Scaramouche, Jan 19, 2004
    #3
  4. Hello

    Before you run the script, you need to install Win32::process::Info package.

    > ppm install Win32-Process-Info


    Good luck.

    "Scaramouche" <> wrote in message news:<erUOb.30782$>...
    > thank you for your help.
    >
    > this is returning an error though,
    > "Can't locate Win32/Process/Info.pm in @INC (@INC contains: C:/Perl/lib
    > C:/Perl/site/lib .) at E:\pscripts\proc.pl line 2. BEGIN failed--compilation
    > aborted at E:\pscripts\proc.pl line 2".
    >
    > currently using activestate's v5.6.1 built for MSWin32-x86-multi-thread.
    > will look into it further.
    >
    > once again, thank you for your help..
    >
    >
    > "Tomofumi Kitano" <> wrote in message
    > news:...
    > > "Scaramouche" <> wrote in message

    > news:<Q0HNb.22543$>...
    > > > is there an equivalent to unixs' ps command in perl?
    > > > i was writing some win32 scripts and i needed a listing of specific
    > > > processes. i could perhaps grep through a list of running processes but

    > how
    > > > can i attain that through perl?
    > > >
    > > > thanks

    > >
    > > I believe Win32::process::Info will help you. For example,
    > >
    > > use Win32::process::Info;
    > > my $pi = Win32::process::Info->new();
    > > my @info = $pi->GetProcInfo();
    > > for my $pid (@info){
    > > print $pid->{"Name"}."\n";
    > > }
    > >
     
    Tomofumi Kitano, Jan 21, 2004
    #4
  5. Scaramouche

    Scaramouche Guest

    thank you, that did the trick.
    this will definitely help me out.

    regards.

    "Tomofumi Kitano" <> wrote in message
    news:...
    > Hello
    >
    > Before you run the script, you need to install Win32::process::Info

    package.
    >
    > > ppm install Win32-Process-Info

    >
    > Good luck.
    >
    > "Scaramouche" <> wrote in message

    news:<erUOb.30782$>...
    > > thank you for your help.
    > >
    > > this is returning an error though,
    > > "Can't locate Win32/Process/Info.pm in @INC (@INC contains: C:/Perl/lib
    > > C:/Perl/site/lib .) at E:\pscripts\proc.pl line 2. BEGIN

    failed--compilation
    > > aborted at E:\pscripts\proc.pl line 2".
    > >
    > > currently using activestate's v5.6.1 built for MSWin32-x86-multi-thread.
    > > will look into it further.
    > >
    > > once again, thank you for your help..
    > >
    > >
    > > "Tomofumi Kitano" <> wrote in message
    > > news:...
    > > > "Scaramouche" <> wrote in message

    > > news:<Q0HNb.22543$>...
    > > > > is there an equivalent to unixs' ps command in perl?
    > > > > i was writing some win32 scripts and i needed a listing of specific
    > > > > processes. i could perhaps grep through a list of running processes

    but
    > > how
    > > > > can i attain that through perl?
    > > > >
    > > > > thanks
    > > >
    > > > I believe Win32::process::Info will help you. For example,
    > > >
    > > > use Win32::process::Info;
    > > > my $pi = Win32::process::Info->new();
    > > > my @info = $pi->GetProcInfo();
    > > > for my $pid (@info){
    > > > print $pid->{"Name"}."\n";
    > > > }
    > > >

    >
     
    Scaramouche, Jan 21, 2004
    #5
    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,239
    Filipe Bonjour
    Jul 26, 2003
  2. Jeff Rodriguez
    Replies:
    23
    Views:
    1,180
    David Schwartz
    Dec 9, 2003
  3. Replies:
    1
    Views:
    294
    Do Re Mi chel La Si Do
    Feb 5, 2005
  4. Junkone

    list of win32 processes

    Junkone, Jan 8, 2008, in forum: Ruby
    Replies:
    1
    Views:
    127
  5. Marc Heiler
    Replies:
    1
    Views:
    187
    Robert Klemme
    May 24, 2009
Loading...

Share This Page