Quote: Original post by way2lazy2careQuote: Original post by SymLinkedQuote: Original post by Don Carnage
Just use task scheduler in Win7 to create a task to run when you want to go to sleep.
Use something like this as your task command:shutdown /h /f
orping -n 20 127.0.0.1 > NUL 2>&1 & shutdown /h /f
if you want some grace time.
Or just use the built in shutdown timer...shutdown -t 60
That'll shut down the computer in 60 seconds and you'll see a timer dialog.
But anyway. Why would anyone want a shutdown to happen? Losing all your hard work if it's forced while you're not there or if you can't react in time. I'd say there must be a better solution.
in windows 7 does the shutdown timer insta-shut down or is it the same as hitting the shutdown button? I think 7 holds the shutdown till your programs have a chance to save/you close all the dialogue boxes asking you to save.
But the OP requested a method of automatically hibernating, not shutting down, hence the /h switch. Also the timeout switch appears not to work with /h, hence the hack time delay.
Best solution is maybe write a little util yourself, then call that from task scheduler. In .Net the call to hibernate is
Application.SetSuspendState(PowerState.Hibernate, true, true);