Detect or intercept moment when a batch is closed via mouse (X console button)

后端 未结 2 1112
栀梦
栀梦 2021-01-07 04:33

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

2条回答
  •  终归单人心
    2021-01-07 05:21

    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.

提交回复
热议问题