in reply to Stopping a file handle process in NT

Have you looked into win32::Process for this? it contains win32::process::killprocess, I think.

-OzzyOsbourne

  • Comment on Re: Stopping a file handle process in NT

Replies are listed 'Best First'.
Re: Re: Stopping a file handle process in NT
by chaydog (Acolyte) on Jan 19, 2001 at 22:13 UTC
    I've explored it (and will again), one problem I have with my code is the $pid comes back with a "1" not the actual process id. I don't know if it's something with the NT build or my code.

      Your code is giving a T/F response, I think. If you open the process with win32::process, I believe that you get the PID this way (not really tested)

      foreach $server (@servers){ Win32::Process::Create($ProcessObj, "c:\\perl\\bin\\perl.exe", "perl.exe c:\\script.pl", 0, NORMAL_PRIORITY_CLASS, ".")|| die ErrorReport(); $ProcessObj->GetProcessID()

      The last bit returns the process ID. To kill it, use:

      Win32::Process::KillProcess($pid, $exitcode)

      -OzzyOsbourne