Sleep Shortcut - Create

Page 3 of 3 FirstFirst 123

  1. Posts : 1,364
    Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
       #20

    Shawn - thx for reply ...

    MourningStar said:
    What I want is a pure standalone Sleep shortcut that I can pin to the taskbar, while leaving all else as is.
    I stumbled across the attached late last night - it works and meets my requirements(quoted above) thus far. I was hoping if you or someone is able to dissect it, show us how it does what it does and relay any 'concerns' if warranted.

    -thx
    Sleep Shortcut - Create Attached Files
      My Computer


  2. Posts : 71,974
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #21

    Thank you for sharing. It scanned clean with Windows Defender.
      My Computer


  3. Posts : 1,364
    Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
       #22

    Brink said:
    Thank you for sharing. It scanned clean with Windows Defender.
    Your welcome. I simply made a shortcut from the .exe via r-clik context menu's Create shortcut. So, will this qualify as a 'Method Three' for this topic?
      My Computer


  4. Posts : 71,974
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #23

    I'll give it some more time to make sure it's safe first since it is an .exe file from an unknown source.
      My Computer


  5. Posts : 1,364
    Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
       #24

    Brink said:
    I'll give it some more time to make sure it's safe first since it is an .exe file from an unknown source.
    fyi, the attachment contains a text file with author contact info.
      My Computer


  6. Posts : 16
    Windows 7 Pro x64
       #25

    MourningStar said:
    Shawn - thx for reply ...
    MourningStar said:
    What I want is a pure standalone Sleep shortcut that I can pin to the taskbar, while leaving all else as is.
    I stumbled across the attached late last night - it works and meets my requirements(quoted above) thus far. I was hoping if you or someone is able to dissect it, show us how it does what it does and relay any 'concerns' if warranted.
    -thx
    I uploaded your Sleep.ZIP file to virustotal.com. The resulting report has 2 hits which state it could be "W32/Symmi.AJ.gen!Eldorado" infected, whatever that is. I don't know if this is correct or not. virustotal.com is a free service which uses 57 different virus scanners. These could be just false positives. However, since the report is not clean, I cannot use this file. I just wanted to give anyone who is thinking about using this file a friendly warning.

    I used the create shortcut method first using the command:
    C:\Windows\System32\rundll32.exe Powrprof.dll,SetSuspendState

    and then:
    C:\Windows\System32\rundll32.exe Powrprof.dll,SetSuspendState Sleep

    Because I have Hibernate enabled, using the shortcut put my computer into Hibernation mode instead of sleep. Unless you turn off Hibernation, you cannot use a simple shortcut to put your PC to sleep. I guess Microsoft just wanted to make things harder for us.
      My Computer


  7. Posts : 71,974
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #26

    It a false positive.

    The file is nothing more than a shortcut that runs a .vbs file, and both are 100% safe and clean. Here's the contents of the .vbs file below.

    Code:
    Dim objShell 
    Set objShell = CreateObject("Shell.Application") 
    objShell.ShutdownWindows
    set objShell = nothing
    Set WshShell = CreateObject("WScript.Shell")
    
    WshShell.SendKeys "{Enter}"
    Set WshShell = Nothing

    Yep, you must have hibernate disabled for the sleep shortcut to work as noted under Method Two.
      My Computer


  8. Posts : 194
    98SE/XP/windows7 ultimate 32bit
       #27

    thanks!
    just used it to my new win7 pc
    OPTION TWO
    Manually Create the Shortcut


    - works like charm
      My Computer


  9. Posts : 71,974
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #28

    You're most welcome prukeyhi. I'm glad it could help. :)
      My Computer


  10. Posts : 565
    Windows 7 Ultimate x32 With Sp1 + Vista Ultimate x32 with Sp1 & Sp2 !!
       #29

    Hi!


    Three things to mention & query :


    1. Sleep.vbs is taking my windows 8.1 x64 laptop to Shut Down even after setting the Power Button to Sleep. Hibernation is on But Hybrid Sleep is Off. Am I supposed to provide any images or reports ?


    2. There are better Icon options available for Sleep function at the address :
    %SystemRoot%\system32\SHELL32.dll

    3. I am using the '' PsShutdown -d -t 0 " command ( SysInternals Utility : PsTools / PsShutdown.exe ) for the shortcut. ( Ref : Microsoft Community Thread : 2nd Response )
    Is it a safe practice technically ?

    Thanks. ...


    UPDATE : Enjoyed! I had to Change Default Action of Alt+F4 "Shut Down Windows" Dialog to Sleep : EightForums i.e. the very same thing as the 4th Option ( Registry Option ) & 5th Option ( Group Policy ) as Change the Default Windows 7 Start Menu Power Button Action to Sleep!

    But Group Policy Registry is not available in windows 8!




    Last edited by Vineet Garg; 08 Apr 2021 at 08:35.
      My Computer


 
Page 3 of 3 FirstFirst 123

  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 23:57.
Find Us