in reply to Re: Stopping a file handle process in NT
in thread Stopping a file handle process in NT

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.
  • Comment on Re: Re: Stopping a file handle process in NT

Replies are listed 'Best First'.
Re: Re: Re: Stopping a file handle process in NT
by OzzyOsbourne (Chaplain) on Jan 29, 2001 at 21:57 UTC

    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