I need to run a batch \"Script A\" and this is only run either when the batch is closed programatically via the \"Do you want to exit [y / n] questions\" or when all the scr
A batch cannot tell when it gets closed from the red X. Therefore, any code handling the close from the X will have to come from somewhere else. One possibility would be to make another batch use TASKLIST to monitor when the first batch gets closed.