469,635 Members | 1,966 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,635 developers. It's quick & easy.

processes in win32

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
Jul 19 '05 #1
4 8203
"Scaramouche" <sp*******@forgetIt.com> wrote in message news:<Q0*******************@nwrddc02.gnilink.net>. ..
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";
}
Jul 19 '05 #2
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" <to************@yahoo.com> wrote in message
news:a7**************************@posting.google.c om...
"Scaramouche" <sp*******@forgetIt.com> wrote in message

news:<Q0*******************@nwrddc02.gnilink.net>. ..
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";
}

Jul 19 '05 #3
Hello

Before you run the script, you need to install Win32::Process::Info package.
ppm install Win32-Process-Info
Good luck.

"Scaramouche" <sp*************@forgetit.com> wrote in message news:<er*****************@twister.tampabay.rr.com> ... 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" <to************@yahoo.com> wrote in message
news:a7**************************@posting.google.c om...
"Scaramouche" <sp*******@forgetIt.com> wrote in message

news:<Q0*******************@nwrddc02.gnilink.net>. ..
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";
}

Jul 19 '05 #4
thank you, that did the trick.
this will definitely help me out.

regards.

"Tomofumi Kitano" <to************@yahoo.com> wrote in message
news:a7**************************@posting.google.c om...
Hello

Before you run the script, you need to install Win32::Process::Info package.
ppm install Win32-Process-Info


Good luck.

"Scaramouche" <sp*************@forgetit.com> wrote in message

news:<er*****************@twister.tampabay.rr.com> ...
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" <to************@yahoo.com> wrote in message
news:a7**************************@posting.google.c om...
"Scaramouche" <sp*******@forgetIt.com> wrote in message

news:<Q0*******************@nwrddc02.gnilink.net>. ..
> 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";
}

Jul 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Guy | last post: by
5 posts views Thread by Chris B | last post: by
2 posts views Thread by ramialhasan | last post: by
5 posts views Thread by plmanikandan | last post: by
4 posts views Thread by rob | last post: by
3 posts views Thread by =?Utf-8?B?THVib21pcg==?= | last post: by
7 posts views Thread by gamename | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.