Try:
Win32::Process
I never used so far myself but can help for what you want.
http://search.cpan.org/author/GSAR/libwin32-0.191/Process/Process.pm

-----Original Message-----
From: Anthony J Segelhorst [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 02, 2003 1:50 PM
To: [EMAIL PROTECTED]
Subject: Killing a windows process using Perl


I have been working on a Perl script that will kill a Windows Process if

it has been running for an x amount of time.  This script will run on a 
Windows Platform.


pslist is a tool that can be retrieved from 
http://www.sysinternals.com/ntw2k/freeware/pstools.shtml
the output from pslist EXCEL looks like:
        C:\Tivoli\lcf\bin\w32-ix86\tools>pslist EXCEL

PsList 1.23 - Process Information Lister
Copyright (C) 1999-2002 Mark Russinovich
Sysinternals - www.sysinternals.com

Process information for CRP-DAY1-S75410:

Name          Pid Pri Thd  Hnd    Mem    User Time   Kernel Time
Elapsed 
Time
EXCEL        2936   8   2  131  16240  0:00:00.015   0:00:00.453 
0:00:13.609


>From Script:
$lcf_tools = $ENV{LCF_TOOLSDIR};
@temparry = `"$lcf_tools\\pslist EXCEL"`;
foreach $temp (@temparray){
 ($name,$pid,$pri,$thd,$hnd,$Mem,$usertime,$kerneltime,$elapsedtime) = 
split(" ",$temp);
        print LOGFILE "name is $name";
        &AnalyzeProcess($name,$elapsedtime);
        }

###&AnalyzeProcess  ---> this will decide to kill the process or  keep
it running

I am having issues getting my array filled, or does someone else already

have a script that does something very similar to what I am wanting to
do.

Anthony J Segelhorst
Enterprise Systems Management Team
Phone: 937-495-1876
Email: [EMAIL PROTECTED]

________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service._______________________________________________________________

Note:  Please update your email address for this user to reflect the new
MeadWestvaco Corporation.  MeadWestvaco employee email addresses are in
the format of [EMAIL PROTECTED] 

This electronic message contains information from MeadWestvaco
Corporation or subsidiary companies, which may be confidential,
privileged or otherwise protected from disclosure.  The information is
intended to be used solely by the recipient(s) named.  If you are not an
intended recipient, be aware that any review, disclosure, copying,
distribution or use of this transmission or its contents is prohibited.
If you have received this transmission in error, please notify
MeadWestvaco immediately at [EMAIL PROTECTED]
_______________________________________________________________________


**** DISCLAIMER ****

"This e-mail and any attachment thereto may contain information which is confidential 
and/or protected by intellectual property rights and are intended for the sole use of 
the recipient(s) named above. 
Any use of the information contained herein (including, but not limited to, total or 
partial reproduction, communication or distribution in any form) by other persons than 
the designated recipient(s) is prohibited. 
If you have received this e-mail in error, please notify the sender either by 
telephone or by e-mail and delete the material from any computer".

Thank you for your cooperation.

For further information about Proximus mobile phone services please see our website at 
http://www.proximus.be or refer to any Proximus agent.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to