in reply to Re: How to kill a windows process by command name?
in thread How to kill a windows process by command name?

You could replace the use of Win32::Process with a call to perl's built-in kill using a signal value of 2 (or 21 or -9 work, as do many others).

use strict; use Win32::Process::Info; Win32::Process::Info->Set(variant=>'WMI'); my $pi = Win32::Process::Info->new(); for($pi->ListPids){ my ($info) = $pi->GetProcInfo($_); if($info->{CommandLine} eq 'perl foo.pl a'){ my $obj; my $pid = $info->{ProcessId}; kill 2, $pid; print "Killed $pid\n\n"; } }

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.