Timed Shortcut for sleep/hibernation?

Page 2 of 3 FirstFirst 123 LastLast

  1. Posts : 1,814
    XP / Win7 x64 Pro
       #11

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


  2. Posts : 78
    Win 7/Pro 64-bit
       #12

    What I really want is to have two icons on my desktop: one for hibernate and one for sleep.
      My Computer


  3. Posts : 1,814
    XP / Win7 x64 Pro
       #13

    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 Computer


  4. Posts : 22,814
    W 7 64-bit Ultimate
       #14

    websquad said:
    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
    Last edited by Brink; 13 Sep 2010 at 13:52. Reason: added links
      My Computer


  5. Posts : 256
    Win 7 ultimate x64 sp1
       #15

    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.
    Last edited by kronckew; 13 Sep 2010 at 13:56.
      My Computer


  6. Posts : 6,885
    Windows 7 Ultimate x64, Mint 9
       #16

    FliGi7 said:
    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 Computer


  7. Posts : 385
    Windows 7 Home Premium x64 OEM --> RTM clean install
       #17

    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.
      My Computer


  8. Posts : 1,814
    XP / Win7 x64 Pro
       #18

    Lordbob75 said:
    FliGi7 said:
    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 Computer


  9. Posts : 6,885
    Windows 7 Ultimate x64, Mint 9
       #19

    FliGi7 said:
    Lordbob75 said:
    FliGi7 said:
    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 Computer


  10. Posts : 1,814
    XP / Win7 x64 Pro
       #20

    Lordbob75 said:
    FliGi7 said:
    Lordbob75 said:
    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 Computer


 
Page 2 of 3 FirstFirst 123 LastLast

  Related Discussions
Our Sites
Site Links
About 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 00:50.
Find Us