By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,187 Members | 1,070 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,187 IT Pros & Developers. It's quick & easy.

processes in win32

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
"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

P: n/a
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

P: n/a
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

P: n/a
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.