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?

2 Answers2

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.

bertieb
  • 7,543
-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.

lex
  • 1,077