killing orphan process in Windows?

W

Woland99

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
and
then that script fails and leaves orphan Excel process. Then
subsequent
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
calls
fails and to kill Excel process?
Or - as alternative - is there a way to kill any Excel orphans before
starting
to process spreadsheets?
Any pointers will be greatly appreciated.

JT
 
J

jamesfred

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
and
then that script fails and leaves orphan Excel process. Then
subsequent
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
calls
fails and to kill Excel process?
Or - as alternative - is there a way to kill any Excel orphans before
starting
to process spreadsheets?
Any pointers will be greatly appreciated.

JT

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
process).

But Win32::OLE may support a better method.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,224
Latest member
BettieToom

Latest Threads

Top