Link to home
Start Free TrialLog in
Avatar of Marketing_Insists
Marketing_Insists

asked on

kill process by name with Perl in win32


I want to kill a process given its name "notepad.exe",
I know that there is a function called kill to do this,
but its argument is processID rather than the process name.

I know Perl can get the PID if it spawns notepad.exe, but the notepad process exists before the perl script is called.

The module below seems to work for cygwin perl,
    http://search.cpan.org/~durist/Proc-ProcessTable-0.39/
but not ActiveState (cygwin is great but it doesn’t play well with clients when the Perl folder is on a network share)

Is there a killall equivalent for Perl that would work on win32?
ASKER CERTIFIED SOLUTION
Avatar of turn123
turn123
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Marketing_Insists
Marketing_Insists

ASKER

LOL I was jsut playing with GuiTest to automate some un-scriptable gui app.  I didn't think of using it to kill stuff.

BTW the GuiTest version available on CPAN comes with a recorder that gives good hints on control functions.
Marketing_Insists,

Cool I'm glad to hear that they got it useable.  I tried it quite a while back and found that it was faster just to code it myself :-).

Turn123