How can I schedule a task to run only when the computer is shut down?

0

Is there a configuration for scheduled tasks to run only when the computer is shut down or more likely prevent a task from running if it hasn't been booted up to run the task? I'd like to run all my system maintenance when I know for sure that no one is using the machine and using configurations dependent on the computers idle isn't meeting my needs.

JMS

Posted 2012-09-11T13:15:16.380

Reputation: 1

3How would you run a task if the computer is shut down? Do you mean you'd want the task to also boot up the machine and then start it. If so, why not leave the computer on, set the task for 1am or similar? – Dave – 2012-09-11T13:20:17.887

Answers

4

There is a StackOverflow post that might help you.

The solution from that post is to launch gpedit.msc (local Policies)

Windows settings -> Scripts -> Shutdown -> Properties -> Add

This will run a script that you provide when the machine is being shut down.

Jesse

Posted 2012-09-11T13:15:16.380

Reputation: 1 066