3
I have an indefinitely running scheduled task that repeats every now and then and runs for few minutes. What happens when this task is running and I click restart or shutdown computer? Will Windows let it finish first before shutdown or will Windows kill the task and then shutdown? Is there a way to change the behavior?
I need to ensure that Windows lets the task to finish before shutting down and I couldn't find information about this. If Windows lets it finish the tasks I'm happy with that but if the Windows kills or aborts my task, I would like to know if there is an automatic Windows way to make Windows wait or is the only way to first stop the tasks manually and then shutdown.
Ok, so I will have to go with program wise shutdown hook. That 2 seconds thing was new to me, thanks for clearing that up. I'll accept this as an answer. – Pehmolelu – 2014-12-02T10:30:23.723