Christine_Chavez_6412

Killing an executable when a job that triggered it is cancelled

Discussion created by Christine_Chavez_6412 on Nov 18, 2016
Latest reply on Nov 19, 2016 by MikeBurnham603785
The windows job will only execute/trigger a command 
(eg: run *.bat, start an exe file etc) and it does not get the PID back from the process it triggered.
Because of this, it will not abort the process it triggered if the windows job gets cancelled.

A workaround would be to have a script or job (in this case, windows job) that will kill the executable if JOBS.*** is cancelled (status <> ANY OK).

In the Post-Process tab of the job, you can activate the script/job that will kill the process:
:set &act# = activate_uc_object(JOBS.WIN.TASKKILL)


Below is a sample command  that is in JOBS.WIN.TASKKILL that will abort Chrome.exe if JOBS.*** is cancelled.

taskkill /F /IM chrome.exe 


*Note that this is just one example. There are other ways to cancel an executable. 

Outcomes