close dos shell upon exit

Welcome Forums General PowerShell Q&A close dos shell upon exit

This topic contains 0 replies, has 1 voice, and was last updated by  Forums Archives 7 years, 2 months ago.

  • Author
  • #5198

    Points: 0
    Rank: Member

    by Banks1850 at 2012-10-16 08:27:07

    hello all, I'm attempting to close a process that runs in a dos shell (I have no control over that aspect).
    let's call them the control window (which starts and stops the process and monitors it for a reason to restart it) and the process window( which actually runs the process).

    I am looking for a way to close the process window so I can restart it again without having multiple dos windows hanging around. I'm looking to do this from the control window.

    Anyone have a way to do this?


    -Steve H.

    by DonJ at 2012-10-18 07:45:50

    Get the process ID of the window and use Stop-Process. Having the OS kill the process will close the window. If you use Start-Process to start the thing, you'll get the process ID from that.

The topic ‘close dos shell upon exit’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort