New
#11
If you go into Power Options and disable hibernation, that command will cause the PC to go into Sleep mode instead.
If you go into Power Options and disable hibernation, that command will cause the PC to go into Sleep mode instead.
What I really want is to have two icons on my desktop: one for hibernate and one for sleep.
Only thing I can think of is to create two batch files with the following (and make sure you run as admin for both when executing)...
Sleep.bat:
@echo off
powercfg -h off
rundll32.exe powrprof.dll,SetSuspendState 0,1,0
powercfg -h on
Hibernate.bat:
@echo off
powercfg -h on
rundll32.exe powrprof.dll,SetSuspendState 0,1,0
Here's this one, I don't see one for the other yet.
Sleep Shortcut - Create
Task Scheduler - Put Computer into Standby Mode
Hibernate Shortcut - Create
Last edited by Brink; 13 Sep 2010 at 13:52. Reason: added links
google for sleep.exe, download it & stick it somewhere in your path, i use c:\windows. make a batch file for the desired action as above with sleep.exe <seconds> as the first line under the @echo off. 3600 secs=1 hr, 7200 secs=2 hrs, etc. one source ishttp://unattended.msfn.org/files/global/sleep.zip , they have a 64 bit version somewhere there as well. another source for the 32bit is microsoft's download centre, but you need to get the whole server resource kit utils pack, it's only 11mb tho.
ie.
@echo off
sleep.exe 7200
<command>
exit
would wait 7200 secs then run the <command>, 'exit' command optional :).
you could save the batch files in c:\windows, paste links to them on the desktop, you can change the default icon on the link in properties where you cannot easily change the icon on the batch files...
sleep.exe is a rather old dos command someone compiled to allow a timed delay in batch files & has nothing to do with putting the pc in the sleep state. name was coincidental.
there is another sleep.exe athttp://www.gammadyne.com/cmdline.htm that IS a util that allows sleep or hybernate from the command line. obviously if you get both, rename one, ie. rename the delay one to delay.exe. OR rename the sleepy one to powerstate.exe or similar. or rename both
You can also do a delay using ping.exe (not CPU intensive).
Example on delay of approx. 5 seconds (number behind -n is seconds +1): command line is:
ping.exe -n 6 localhost >nul
not sure how that would work on large n values.
Last edited by kronckew; 13 Sep 2010 at 13:56.
Are you guys missing the power shell? When I was dabbling with Ubuntu, I had some aliases set up in my bashrc. file, when I was experimenting with the Terminal. I see Windows has stol, er, borrowed this. In Linux I had as an alias "zzz <x amount of minutes>" and it would run the bash command sudo shutdown -h <minutes> .
I haven't investigated the PowerShell yet but maybe someone knows?...:)
Last edited by allend66; 14 Sep 2010 at 03:08.
Unless I'm missing something here, I don't see how turning off Hybrid Sleep pertains to the question at hand or my response of disabling hibernation to enable the command to put the computer into sleep mode. Simply turning off Hybrid Sleep as you've posted will not put the computer into Sleep mode via the command previously posted. You still have to disable hibernation.
Am I missing something else?