Killer on the loose.

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Where I work they have this PITA sort of kind of like a EULA that pops
up on my screen (in a notepade.exe window) when I authenticate into
the mothership. So, naturally I resented the hell out of it. The
obligitory mouse click is not to be tolerated till at least after
lunch. So I wrote this little diddy. Have a look, it's very simple.

I was hoping for comments about how to make it faster, to optimize it.
I hope the misc part of the NG's name is comprehensive, so I stay on

use Win32::Process;
use Win32::OLE('in');
$sobj = Win32::OLE->GetObject(
 or die "can't create server object: ".Win32::OLE->LastError(  )."\n";
$i = 99;
while ( $i )  {
foreach $process (in $sobj->InstancesOf("Win32_Process")){
  push (@list, " $process-> , $process-> \n");
foreach(@list) { if ((/notepad.exe/)||(/NOTEPAD.EXE/)) { # I know
                             # about //i    
                                      $_ =~ s/\D//g;
                                      kill 9, $_ ;
                                      $i = 0;

Re: Killer on the loose.

Quoted text here. Click to load it

   if ( /notepad\.exe/i ) {

or, probably much better:

   if ( lc() eq 'notepad.exe' ) {

Quoted text here. Click to load it


    Tad McClellan                          SGML consulting                   Perl programming
    Fort Worth, Texas

Site Timeline