Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: using perl to stop processes on windows

by esskar (Deacon)
on Mar 03, 2004 at 19:41 UTC ( [id://333664]=note: print w/replies, xml ) Need Help??


in reply to using perl to stop processes on windows

use strict; use Win32; use Win32::Process; use Win32::Process::Info; my $exe = "yourexe.exe"; my $pi = Win32::Process::Info->new("\\\\someserver.domain.de"); foreach my $hashref ($pi->GetProcInfo()) { my $exitcode = undef; print "Process: $hashref->{Name}\n"; if(lc($hashref->{Name}) eq $exe) { Win32::Process::KillProcess($hashref->{ProcessId}, $exitcode); } }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://333664]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-04-19 20:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found