Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Perl (http://www.velocityreviews.com/forums/f17-perl.html)
-   -   processes in win32 (http://www.velocityreviews.com/forums/t24752-processes-in-win32.html)

Scaramouche 01-16-2004 01:21 AM

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



Tomofumi Kitano 01-18-2004 07:00 AM

Re: processes in win32
 
"Scaramouche" <spamSucks@forgetIt.com> wrote in message news:<Q0HNb.22543$4l3.15197@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";
}

Scaramouche 01-19-2004 05:26 PM

Re: processes in win32
 
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" <tomofumikitano@yahoo.com> wrote in message
news:a7619467.0401172300.35da56e0@posting.google.c om...
> "Scaramouche" <spamSucks@forgetIt.com> wrote in message

news:<Q0HNb.22543$4l3.15197@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";
> }
>




Tomofumi Kitano 01-21-2004 03:48 AM

Re: processes in win32
 
Hello

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

> ppm install Win32-Process-Info


Good luck.

"Scaramouche" <spamReallySucks@forgetit.com> wrote in message news:<erUOb.30782$Bj.6287@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" <tomofumikitano@yahoo.com> wrote in message
> news:a7619467.0401172300.35da56e0@posting.google.c om...
> > "Scaramouche" <spamSucks@forgetIt.com> wrote in message

> news:<Q0HNb.22543$4l3.15197@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";
> > }
> >


Scaramouche 01-21-2004 02:34 PM

Re: processes in win32
 
thank you, that did the trick.
this will definitely help me out.

regards.

"Tomofumi Kitano" <tomofumikitano@yahoo.com> wrote in message
news:a7619467.0401201948.62f15184@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" <spamReallySucks@forgetit.com> wrote in message

news:<erUOb.30782$Bj.6287@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" <tomofumikitano@yahoo.com> wrote in message
> > news:a7619467.0401172300.35da56e0@posting.google.c om...
> > > "Scaramouche" <spamSucks@forgetIt.com> wrote in message

> > news:<Q0HNb.22543$4l3.15197@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";
> > > }
> > >

>





All times are GMT. The time now is 09:34 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.