in reply to Kill a perl script execution in windows
Try
#! perl -slw use strict; print "$0 running as $$"; my( $target ) = map { 1+ index( $_->[0] // '', $0 ) && $_->[1] != $$ ? $_->[1] : () } map[ (split ',', $_ )[1,24] ], `wmic process list full /format:csv`; if( $target ) { print "Found another running as $target; usurping it."; kill 9, $target; } sleep 1e6;
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Kill a perl script execution in windows
by rbala (Acolyte) on Feb 18, 2013 at 10:42 UTC | |
by BrowserUk (Patriarch) on Feb 18, 2013 at 11:26 UTC | |
by rbala (Acolyte) on Feb 18, 2013 at 13:37 UTC | |
by rbala (Acolyte) on Feb 18, 2013 at 14:13 UTC | |
by BrowserUk (Patriarch) on Feb 18, 2013 at 22:35 UTC |
In Section
Seekers of Perl Wisdom