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
.
Is it a good idea to shut down or put to sleep my PC seconds after
some very heavy processing load on the CPU or GPU?
It is neither a bad idea or a good idea. A PC is designed to be turned off, put to sleep, and to be left on. It being used at 100% load or 0% load makes no difference, it is designed to be used, any failures will not be linked to the type of work it does.
I'm asking this because i'm not sure if the cooling system has enough
time to cool the components down to an acceptable temperature before
the shut down; that would mean that the components might even be
damaged or have their lifespan significantly reduced due to
insufficient cooling.
If electricity is being ran through a circuit, and the temperature of the corespondents are within their specification, then having no electricity and the temperature still being within the specifications makes no difference. Your PC will cool itself off faster, without being turned on, for obvious reasons. I have left my last 4 computers, spanning over 20 years, turned on 24/7/365.
If the system is cooled enough to keep the system stable for 12 hours a day then its stable enough to be ran 24/7/365.
Should i worry about this or does the hardware is smart enough not to
shut down the cooling before it reaches an acceptable temperature?
There is nothing to worry about. The cooling system in a general sense does not care if the system is at 100% load or 50% load it will continue to cool the system no matter what.
You do understand, the hardware is not smart enough to do anything it was not designed to do, right?
Best Answer
The original recommendation - TimeComX, is now only found on shared hosting sites and has been discontinued.
Via Lifehacker, this seems to be a worthy alternative (no personal experience):
Several features of note:
(image via developer)