I'm a bit confused on what "problem/issue" you are encountering. The title you chose and the information that you shared makes it sound like your trying to treat the symptoms rather than the disease (to borrow a medical analogy). In other words, it sounds like you want to find a way to kill an orphaned process (the symptom) rather than fixing the script that is orphaning the process (the disease).

First, you should probably modify your code so that it first checks to see if an instance of Word is running. If there is one running, use it. If not, start one.

Second, your script should include error trapping to ensure that your code does not leave an orphaned process.

If my suspicions about what you're encountering are correct, doing these things might eliminate your "need" to "end a process in windows".

(By the way, if a user is actively using Word on the remote system, ending the Word process at the start of the Perl script could create more problems for you.)


In reply to Re: To end process in windows by dasgar
in thread To end process in windows by nico7nibor

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.