2

Just like you can set Windows 7 to hibernate after sleeping for X amount of time, can you also make it shutdown after a sleeping for a specific number of hours too?

There doesn't seem to be a direct option available for this, but I'm guessing there might be some way to do this through Task Scheduler?

3
  • 1
    Why do you want it to shutdown instead of hibernate? If it's for powersaving reasons, then hibernate and shutdown are the same.
    – Emily L.
    Jul 1, 2015 at 10:21
  • I could swear this asked about hibernating; perhaps I had a brain fade (as they're now calling it) and misconstrued. I've updated my answer to include shutdown info.
    – bertieb
    Jul 2, 2015 at 15:58
  • You could use wake timers to get this done, I think.
    – Vinayak
    Jul 3, 2015 at 9:47

2 Answers 2

1

Building on oldmud0's excellent answer in Automatically hibernate Windows 8.1 after 15+ minutes inactivity, it should be possible to do indirectly, which may be enough for your purposes.

1) Set computer to sleep after the desired time, say When plugged in, PC goes to sleep after 2 hours

2) Using Task Scheduler (win+r -> taskschd.msc) go to Action -> Create Task

3) On the General tab, enable Run whether or not user is logged on or not and Run with highest privileges

4) On the Triggers tab, add a New... condition with On idle and leave it enabled.

5) On the Conditions tab, check Start the task only if the computer is idle for and enter your desired 'hibernate-after' time + 2h (since the sleep duration must be considered).

If you set 4 hours for example, the computer should sleep after 2 hours of being inactive (as per step 1) and then hibernate after a further 2 hours.

6) On the Actions tab, add a New... action to run shutdown with the additional argument of -h (for hibernate)

That combination should get you the desired behaviour - sleeping after a certain period of inactivity, and then hibernating.

Note: I haven't tested this but it sounds like a good idea, so I may well try tonight!

Edit:

blink

I could swear this asked about hibernating after sleeping; not shutting down after sleeping. I will leave pre-edit as is, but at point 6), use the additional parameter -s (for shutdown) instead of -h.

-2

I don't think its technically possible and can be a huge mass. From Sleep to hibernation, all your work is still saved and the computer is completely powered off, but you could lose all your work with an unattended sleep to shutdown.

Edit: At least its not something a normal user would want to do, or something Windows wanted a user to do. Its not possible with builtin tools -- no, scheduled task wouldn't work as the computer can only be waked up by power button/BIOS events from hibernation, but not task scheduler. Its remotely possible that one can write a service/program which kicks at the middle of sleep->wakeup->hibernation process to enforce a shutdown.

1
  • This answer would be a great deal better if you could confirm without a shadow of a doubt if it was or was not technically possible. This is the type of response I expect from answers located on Yahoo not Superuser.
    – Ramhound
    Jul 1, 2015 at 12:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .