killing orphan process in Windows?

Discussion in 'Perl Misc' started by Woland99, Aug 24, 2008.

  1. Woland99

    Woland99 Guest

    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
     
    Woland99, Aug 24, 2008
    #1
    1. Advertising

  2. Woland99

    Guest

    On Aug 24, 4:41 am, Woland99 <> wrote:
    > 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.
     
    , Aug 24, 2008
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. darrel

    VS.net orphan clean up tool?

    darrel, Aug 16, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    574
    Levi Rosol
    Aug 16, 2004
  2. PP: Orphan Assemblies List

    , Mar 9, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    326
  3. V S Rawat

    orphan code lines

    V S Rawat, Jun 15, 2004, in forum: Java
    Replies:
    11
    Views:
    884
    Chris Smith
    Jun 17, 2004
  4. Wayne...

    orphan iframe problem

    Wayne..., Mar 23, 2005, in forum: HTML
    Replies:
    2
    Views:
    479
    Wayne...
    Mar 24, 2005
  5. Sting

    killing a process in ms windows - newbie

    Sting, Dec 28, 2003, in forum: C Programming
    Replies:
    2
    Views:
    336
    Richard Bos
    Dec 29, 2003
Loading...

Share This Page