473,398 Members | 2,368 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

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 8440
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Guy | last post by:
Hi I've done some projects in python for my work which invole some test scripts etc. All quite basic stuff, I find python a good language to work in but have come up against a brick wall. I'm...
5
by: Chris B | last post by:
I have the following situation: Process 1 creates Process 2 (using Process.Start(startInfo) Process 1 needs to wait until Process 2 is initialized before Process 1 can continue to execute Both...
2
by: D | last post by:
I have an array of processes declared like so System.Diagnostics.Process _ProcessArray = new System.Diagnostics.Process; and the code below shows how I iterate thru the array and looking for a...
2
by: ramialhasan | last post by:
I have good experience with COM ATL object, but recently I needed to deal with Win32 DLLs. I have some question relating to their model of work. In COM objects every client of the com server...
0
by: Peter Strøiman | last post by:
Hi I have a windows 2003 test server. I installed a web application on it, including the debug symbol files. I also installed the remote debugger from the Visual Studio 2003 DVD. My client is...
5
by: plmanikandan | last post by:
Hi, I have written a win32 console application(exname1.exe) which runs for ten minutes.I am calling this exname1.exe from another exe named exname.exe using shellexecuteex.Now from exname.exe...
4
by: rob | last post by:
Is there a relatively easy way to send text from a Win32 process to a ..NET process, preferably in VC++ for the Win32 side and C# for .NET.
3
by: =?Utf-8?B?THVib21pcg==?= | last post by:
C#, .NET 2.0 Hi, I have two processes and I need that one process will notify the other. I could use the EventWaitHandle object and create an (named) event, but this doesn't allow me to...
7
by: gamename | last post by:
Hi, Is it still the case there is no practical Expect-like module for win32? I know that cygwin can support pexpect, but that isn't an option here --- I have to use a native win32 Python...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.