close dos shell upon exit

This topic contains 0 replies, has 1 voice, and was last updated by Profile photo of Forums Archives Forums Archives 5 years, 5 months ago.

  • Author
    Posts
  • #5198

    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?

    thanks,

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

You must be logged in to reply to this topic.