Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > processes in win32

Reply
Thread Tools

processes in win32

 
 
Scaramouche
Guest
Posts: n/a
 
      01-16-2004
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


 
Reply With Quote
 
 
 
 
Tomofumi Kitano
Guest
Posts: n/a
 
      01-18-2004
"Scaramouche" <(E-Mail Removed)> wrote in message news:<Q0HNb.22543$(E-Mail Removed)>. ..
> 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:rocess::Info will help you. For example,

use Win32:rocess::Info;
my $pi = Win32:rocess::Info->new();
my @info = $pi->GetProcInfo();
for my $pid (@info){
print $pid->{"Name"}."\n";
}
 
Reply With Quote
 
 
 
 
Scaramouche
Guest
Posts: n/a
 
      01-19-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> "Scaramouche" <(E-Mail Removed)> wrote in message

news:<Q0HNb.22543$(E-Mail Removed)>. ..
> > 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:rocess::Info will help you. For example,
>
> use Win32:rocess::Info;
> my $pi = Win32:rocess::Info->new();
> my @info = $pi->GetProcInfo();
> for my $pid (@info){
> print $pid->{"Name"}."\n";
> }
>



 
Reply With Quote
 
Tomofumi Kitano
Guest
Posts: n/a
 
      01-21-2004
Hello

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

> ppm install Win32-Process-Info


Good luck.

"Scaramouche" <(E-Mail Removed)> wrote in message news:<erUOb.30782$(E-Mail Removed)> ...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) om...
> > "Scaramouche" <(E-Mail Removed)> wrote in message

> news:<Q0HNb.22543$(E-Mail Removed)>. ..
> > > 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:rocess::Info will help you. For example,
> >
> > use Win32:rocess::Info;
> > my $pi = Win32:rocess::Info->new();
> > my @info = $pi->GetProcInfo();
> > for my $pid (@info){
> > print $pid->{"Name"}."\n";
> > }
> >

 
Reply With Quote
 
Scaramouche
Guest
Posts: n/a
 
      01-21-2004
thank you, that did the trick.
this will definitely help me out.

regards.

"Tomofumi Kitano" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> Hello
>
> Before you run the script, you need to install Win32:rocess::Info

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

>
> Good luck.
>
> "Scaramouche" <(E-Mail Removed)> wrote in message

news:<erUOb.30782$(E-Mail Removed)> ...
> > 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" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed) om...
> > > "Scaramouche" <(E-Mail Removed)> wrote in message

> > news:<Q0HNb.22543$(E-Mail Removed)>. ..
> > > > 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:rocess::Info will help you. For example,
> > >
> > > use Win32:rocess::Info;
> > > my $pi = Win32:rocess::Info->new();
> > > my @info = $pi->GetProcInfo();
> > > for my $pid (@info){
> > > print $pid->{"Name"}."\n";
> > > }
> > >

>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Controlling processes and what to "feed" other processes Marc Heiler Ruby 1 05-24-2009 05:37 PM
list of win32 processes Junkone Ruby 1 01-08-2008 12:42 PM
Python Processes for Win32 harlinseritt@yahoo.com Python 1 02-05-2005 11:07 AM
How do I: Main thread spawn child threads, which child processes...control those child processes? Jeff Rodriguez C Programming 23 12-09-2003 11:06 PM
Listing processes using Perl (Win32) Filipe Bonjour Perl 0 07-26-2003 04:49 PM



Advertisments