Is there any way to make a desktop shortcut for the sleep command?

Anonymous
2009-01-10T03:57:52+00:00

Desktop shortcut for the sleep command?

Is there any way to make a desktop shortcut for the sleep command? I can't find the actual location that the sleep button on the start menu points to. It has to point somewhere! Please, if anyone knows how i can create this shortcut, help!!! Thanks a bunch!

Windows for home | Previous Windows versions | Accessibility

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
Answer accepted by question author
Anonymous
2009-01-10T12:18:27+00:00

Tar-ter,

To create a shortcut that will execute the sleep command in Vista:

  • Right Click in the desired location (On the Desktop or in a folder)
  • Select New -> Shortcut
  • In the “Type the location of the item” field enter the following
  • Rundll32.exe Powrprof.dll,SetSuspendState Sleep
  • Click Next
  • This will create a shortcut with the name rundll32,
  • Right Click the shortcut, select Rename and type in Sleep

**** You can now open this shortcut whenever you desire to put your computer into sleep mode.

Note: You can replace the default icon with a Shutdown one by:

  • Right Click the created shortcut, select Properties -> Change Icon
  • Navigate to this link in the **“**Look for icons in this file:” field:
  • %SystemRoot%\system32\SHELL32.dll icons
  • Find the desired icon.
  • Click Ok.

Thank you for using the Microsoft Vista Support Community.


Rami

Microsoft Answers Support Engineer

Visit our Microsoft Answers Feedback Forum and let us know what you think.

Was this answer helpful?

60+ people found this answer helpful.
0 comments No comments

73 additional answers

Sort by: Most helpful
  1. Anonymous
    2015-09-27T01:53:41+00:00

    Yes, that is exactly as expected.  Sadly, all the suggestions utilizing the "rundll32.exe powrprof.dll,SetSuspendState 0,0,0" or "rundll32.exe powrprof.dll,SetSuspendState Sleep" command are mislead.  It is not supposed to work, and does so in certain circumstances inadvertently.  The SetSuspendState function expects three parameters:

    1. Hibernate (Boolean; Standby if false)
    2. Force (Boolean)
    3. NoWakeTimers (Boolean)

        All would be fine and dandy if Rundll32 passed the parameters on as specified.  However, it does notRundll32 uses the following preset parameters, regardless of the arguments passed to it:

    1. hWnd (dWord preset to the parent window specified in the start command for Rundll32)
    2. hInst (dWord preset to the loaded instance of the specified DLL)
    3. sCmdLine (address to string containing all the arguments you passed to Rundll32)
    4. nCmdShow (dWord preset to the start mode you ran Rundll32 with, e.g. minimized, maximized, normal, normal no focus).

        All those parameters will be non-zero numbers regardless of what you specify in the command line.  Therefore, any call to SetSuspendState from Rundll32 will equal calling SetSuspendState (True, True, True), which asks the system to force hibernate and disable all scheduled tasks that are scheduled to wake the computer up.  Disabling hibernation and then asking Windows to enter hibernation is not a very good workaround to accomplish standby.

    So, here are some valid commands:

    Lock rundll32 user32,LockWorkStation
    Log off shutdown -l
    Restart (requires admin) shutdown -r -t 0
    Full Shutdown (requires admin) shutdown -s -t 0
    Fast Shutdown (requires admin) shutdown -s -t 0 -hybrid
    Hibernate shutdown -h
    Standby (requires PsShutdown tool) psshutdown -d -t 0

        Unfortunately, after all the features it has, the Microsoft shutdown command is missing the standby feature!  So, it you want to put your computer to sleep via command line, you'll need to install a more capable tool before you can use the last command above:

    1. Download Sysinternals PsTools.
    2. The download should be a ZIP file.  Open it and copy PsShutdown.exe to your desktop.
    3. On your desktop, right-click PsShutdown.exe and click Copy.  Right-click it again and click Properties.
    4. Tick Unblock and click [OK].
    5. Open File Explorer, navigate to "C:\Windows", scroll down, right-click the system32 folder and click Paste.
    6. To enter standby, you can now use this command: psshutdown -d -t 0

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2015-09-02T05:02:25+00:00

    Unfortunately, this procedure shuts down my dell xps 8700, win.8.1 which cannot be

    awoken without pressing the start button on the computer.  Perhaps this is good

    for vista only.  thanks anyway.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2015-08-31T23:20:24+00:00

    Shuts down my Dell Venue11Pro.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2015-08-25T20:41:48+00:00

    I just put a shortcut on the desktop and made a keyboard shortcut for it.

    http://www.sevenforums.com/tutorials/61430-sleep-shortcut-create.html

    Was this answer helpful?

    0 comments No comments