Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Timed Shortcut for sleep/hibernation?

13 Sep 2010   #11
FliGi7

XP / Win7 x64 Pro
 
 

If you go into Power Options and disable hibernation, that command will cause the PC to go into Sleep mode instead.


My System SpecsSystem Spec
.
13 Sep 2010   #12
websquad

Win 7/Pro 64-bit
 
 

What I really want is to have two icons on my desktop: one for hibernate and one for sleep.
My System SpecsSystem Spec
13 Sep 2010   #13
FliGi7

XP / Win7 x64 Pro
 
 

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
My System SpecsSystem Spec
.

13 Sep 2010   #14
Bare Foot Kid
Microsoft MVP

W 7 64-bit Ultimate
 
 

Quote   Quote: Originally Posted by websquad View Post
What I really want is to have two icons on my desktop: one for hibernate and one for sleep.




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
My System SpecsSystem Spec
13 Sep 2010   #15
kronckew

Win 7 ultimate x64 sp1
 
 

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 is http://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 at http://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.
My System SpecsSystem Spec
13 Sep 2010   #16
Lordbob75

Windows 7 Ultimate x64, Mint 9
 
 

Quote   Quote: Originally Posted by FliGi7 View Post
If you go into Power Options and disable hibernation, that command will cause the PC to go into Sleep mode instead.
You actually just turn off Hyrbid Sleep.

~Lordbob
My System SpecsSystem Spec
14 Sep 2010   #17
allend66

Windows 7 Home Premium x64 OEM --> RTM clean install
 
 

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?...
My System SpecsSystem Spec
14 Sep 2010   #18
FliGi7

XP / Win7 x64 Pro
 
 

Quote   Quote: Originally Posted by Lordbob75 View Post
Quote   Quote: Originally Posted by FliGi7 View Post
If you go into Power Options and disable hibernation, that command will cause the PC to go into Sleep mode instead.
You actually just turn off Hyrbid Sleep.

~Lordbob

What exactly are you referring to here? Who turns off Hybrid Sleep and how?
My System SpecsSystem Spec
14 Sep 2010   #19
Lordbob75

Windows 7 Ultimate x64, Mint 9
 
 

Quote   Quote: Originally Posted by FliGi7 View Post
Quote   Quote: Originally Posted by Lordbob75 View Post
Quote   Quote: Originally Posted by FliGi7 View Post
If you go into Power Options and disable hibernation, that command will cause the PC to go into Sleep mode instead.
You actually just turn off Hyrbid Sleep.

~Lordbob

What exactly are you referring to here? Who turns off Hybrid Sleep and how?
Windows Does Not Start After Sleep

~Lordbob
My System SpecsSystem Spec
14 Sep 2010   #20
FliGi7

XP / Win7 x64 Pro
 
 

Quote   Quote: Originally Posted by Lordbob75 View Post
Quote   Quote: Originally Posted by FliGi7 View Post
Quote   Quote: Originally Posted by Lordbob75 View Post
You actually just turn off Hyrbid Sleep.

~Lordbob

What exactly are you referring to here? Who turns off Hybrid Sleep and how?
Windows Does Not Start After Sleep

~Lordbob
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?
My System SpecsSystem Spec
Reply

 Timed Shortcut for sleep/hibernation?




Thread Tools




Similar help and support threads
Thread Forum
Hibernation or sleep?
I forgot to turn off the hibernation / sleep in windows 7 and forgot to safely remove the external 3.5 desktop hard drives from it. I think my external drives need safely remove The computer had gone into sleep and then it powered up suddenly when I pressed a key on keyboard will this cause any...
General Discussion
Sleep/Hibernation Problem
I have installed a new version of win 7 and my PC is not sleeping/hibernating more than a few seconds before waking up again. I have to change the BIOS settings for the keyboard & mouse, I have unplugged them immediately after putting my pc to sleep and it still wakes up. What can I do?
Software
Sleep and hibernation question
would ether prevent a thunder storm from screwing up my mobo R is powering off the pc better then both to prevent it R unplugging it
General Discussion
BSOD after sleep/hibernation
My computer is running Windows Ultimate 64 bit edition. When awaking form sleep mode, I get a BSOD. As instructed, I am attaching the compressed file. Any and all help will be appreciated!
BSOD Help and Support
Sleep & Hibernation modes
Ever since first installing Windows 7 I have experienced problems with both the Sleep and Hibernation modes. Having configured the the settings for these uncder Control Panel/Power options/Advanced settings it eems that these two modes then operate at the time intervals which have been configured....
Performance & Maintenance
Hibernation vs Sleep?
well i have a laptop (feel free to look at the specs) and i usually do hibernation to let my laptop rest to go do something and then i also see "sleep" mode right above the hibernation...what is the difference and which is better that loads up to my desktop faster and back to action? (meaning i be...
Performance & Maintenance


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 10:54.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App