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
    2014-08-06T20:35:03+00:00

    I followed the steps given by Rami

    "

    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

    I, however, changed the command to the following:

    • Rundll32.exe Powrprof.dll,SetSuspendState 0,1,0

    Then picked right back up with Rami's steps

    • Click Next
    • This will create a shortcut with the name rundll32,
    • Right Click the shortcut, select Rename and type in Sleep

    Hope this helps

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2014-07-28T18:33:53+00:00

    Thanks! Works like a charm. All the other options put my PC in hibernation, not sleep.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2014-06-12T05:32:46+00:00

    Via the SHExitWindowsEx

    Using the User.exe & User32.dll Exit Windows functions doesn't allow any control over what type of shutdown is preformed as parameters aren't passed, they operate as if 0 is passed - which is shutdown for ExitWindows and Logoff for ExitWindowsEx. An undocumented function SHExitWindowsEx in Shell32.dll which is what Explorer seems to use does take parameters.

    rundll32.exe shell32.dll,SHExitWindowsEx [optional number in hex]
    
    EWX_LOGOFF 0
    EWX_SHUTDOWN 1
    EWX_REBOOT 2
    EWX_FORCE 4
    EWX_POWEROFF <br><br>for machines that turn off their own power 8

    These values can be added together, eg, 5 is shutdown and force applications to close and an implicit logoff.

    Note their is no Restart without rebooting. This requires a parameter of 42 (hex) to be passed to ExitWindows in User.exe. This can't be done from the command line. See tip above for a work around.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2014-06-11T21:57:01+00:00

    The procedure for creating a sleep shortcut by using the "**Rundll32.exe Powrprof.dll,SetSuspendState Sleep"**does not work  on my 8.1 -- instead, it shuts the computer down.  I followed the directions explicitly  twice with the same results. Any other method for

    accomplishing this need?

    Phil

    Was this answer helpful?

    0 comments No comments