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;
|
|---|
| 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 |