processes in win32

S

Scaramouche

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
 
T

Tomofumi Kitano

Scaramouche said:
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";
}
 
S

Scaramouche

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..
 

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,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top