in reply to Re^3: End a process in the Task manager
in thread End a process in the Task manager

Thank u very much. I installed Win32::Process::Info. now if I try to kill a process, as follows
$pid = 1768; Win32::Process::KillProcess($pid,0);
I get an error
Undefined subroutine &Win32::Process::KillProcess called at C:\perlscr +ipts\pidin fo.pl line 51, <DATA> line 164.
how do I kill the process?

Replies are listed 'Best First'.
Re^5: End a process in the Task manager
by BrowserUk (Patriarch) on Jun 06, 2005 at 07:25 UTC

    Try

    kill 2, 1768;

    See kill

    FYI. Win32::Process is a separate module from Win32::Process::Info that would require you to find and install it before you can use it. However, Perl's built-in kill function works fine for this.


    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".
    The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.
      Thank u very much. It works fine.