Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
How 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 Sep 11 '12 at 13:20

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.