Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Getting a list of all running apps/processes in Win32 then shutting down a given process

by gaggio (Friar)
on Jul 26, 2000 at 18:50 UTC ( #24498=note: print w/ replies, xml ) Need Help??


in reply to Getting a list of all running apps/processes in Win32 then shutting down a given process


To get the process list (a hash with the pids as a key, use my function). As said before, this function works for the local machine or for a remote machine - just give the ip you want (127.0.0.1 for the local machine).

Then you can just find the pid you want to kill (by doing a search on the processes names, probably) and use the function Win32::Process::KillProcess, like this:

my $actually_killed = Win32::Process::KillProcess($pid,0);
Please note that you should check that the function is returning the pid you killed, to test if it did it OK.


Comment on Re: Getting a list of all running apps/processes in Win32 then shutting down a given process
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2014-07-23 01:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (130 votes), past polls