killing orphan process in Windows?

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

Threaded View

Howdy - I have a Perl script that uses fairly standard Win32::OLE
calls to
read Excel spreadsheets and feed data into build process. Every now
then that script fails and leaves orphan Excel process. Then
build fails and you need to manually connect to build machine and use
Task Manager to kill Excel process before restarting build.
Is there a way to safely clean after yourself if any of the Win32::OLE
fails and to kill Excel process?
Or - as alternative - is there a way to kill any Excel orphans before
to process spreadsheets?
Any pointers will be greatly appreciated.


Re: killing orphan process in Windows?

Quoted text here. Click to load it

If you have the pid of the Excel process, you can

  eval "END { kill(9, $pid) unless $finished }"; $@ and die $@;

where $finished is true if you know that Excel has actually
finished (otherwise you could end up killing another unrelated

But Win32::OLE may support a better method.

Site Timeline