Assisting 13778381 developers since 2005.

Web Developer, Open Source, Loyal, Dad.  

Read More »

How to Create Restart, Shutdown, Sleep Icons in Windows 7 & Vista Desktop

Posted by David  •  Aug 17th, 2009 7:18:37 am - Subscribe | Mood: good | Music: No music

This entry will show you How to Create Lock Restart & Shutdown Icons in Windows 7 & Vista. This process is as simple as creating a shortcut, adding a command to that shortcut, then simply adding an icon to accompany it. Let me show you how to do it with the shutdown button.


  1. Right click the Desktop
  2. New
  3. Shortcut
  4. Enter in the browse location
  5. Shutdown.exe -s -t 00
  6. Name the shortcut 'Shutdown'
  7. Now right click the new shortcut
  8. Properties
  9. Change Icon*
  10. Choose the Shutdown Icon
  11. Ok


* NOTE: If you do not have a list of icons go back to step #9 and enter this in the browse section: %SystemRoot%\System32\shell32.dll

quote:

Windows 7 System Command Lines
  • Shutdown Command - Shutdown.exe -s -t 00
  • Restart Command - Shutdown.exe -r -t 00
  • Lock Workstation Command - Rundll32.exe User32.dll,LockWorkStation
  • Hibernate Workstation Command - rundll32.exe PowrProf.dll,SetSuspendState
  • Sleep Computer Command - rundll32.exe powrprof.dll,SetSuspendState 0,1,0


  • Now you can add these icons that you created to your Aero Taskbar or to your Windows 7 Quick Launch.

    If you have any questions leave a comment.

    Comments 20  •  Aug 17th, 2009 7:18:37 am - Subscribe  •  Tweet this entry | Post a comment



    Responses

    anonymous Says:
    August 26th, 2009

    I tried doing the sleep command but it's the same at the hibernate one i don't know whats wrong

    anonymous Says:
    September 16th, 2009

    Yeah - Sleep one doesn't work - same as Hibernate.

    anonymous Says:
    November 01st, 2009

    Ye the sleep command makes the system hibernate for me as well. Any fixes yet?

    anonymous Says:
    November 07th, 2009

    Sleep works fine for me. It must be the s1/s3 settings in your bios that may be affecting things. I also have hibernate turned off, perhaps that helps. Either way, that sleep command has the desired effect, sorry it doesn't for you guys

    anonymous Says:
    November 08th, 2009

    Windows 7 SLEEP from the SHUTDOWN menu has a shorter wakeup sequence. It skips the usual BIOS POWERON tests I go through when I use RUNDLL32/POWRPROF from a shortcut. I would like to know how to get the shorter wakeup using a shortcut.

    anonymous Says:
    December 26th, 2009

    This sleep command puts the machine in HIBERATE instead

    Sleep Computer Command - rundll32.exe powrprof.dll,SetSuspendState 0,1,0


    anyone know the correct codes?

    anonymous Says:
    January 19th, 2010

    The only way i find - is to turn off the hibernation mode. It seems to me, that this article is wrong:
    h__p://msdn.microsoft.com/en-us/library/aa373201(VS.85).aspx

    anonymous Says:
    April 08th, 2010

    Create a batch file with the following:

    @echo off
    powercfg -h off
    rundll32.exe powrprof.dll,SetSuspendState 0,1,0
    powercfg -h on

    Then create the desktop shortcut and use the Browse to point to it.

    anonymous Says:
    April 28th, 2010

    the command "rundll32.exe powrprof.dll,SetSuspendState 0,1,0" for sleep is correct, however, it will hibernate instead of sleep if u dont turn the hibernation off.

    here's how: start menu, open up ur cmd.exe by right clicking and opening as ADMINISTATOR.
    then type "powercfg -hibernate off" w/o the quotations.
    that's it.

    anonymous Says:
    September 02nd, 2010

    No it's not correct - It is hibernating and by turning hibernate off it is forced to sleep only - still need a command to sleep with out having to force hibernate on and off

    anonymous Says:
    September 30th, 2010

    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.

    anonymous Says:
    October 03rd, 2010

    re: "January 19th, 2010

    The only way i find - is to turn off the hibernation mode. It seems to me, that this article is wrong:
    h__p://msdn.microsoft.com/en-us/library/aa373201(VS.85).aspx"
    either-or, tried diff options:
    sleep button shortcut only works with hibernate off.

    anonymous Says:
    December 18th, 2010

    THIS IS WORKING CODE (TESTED only ON MACHINE with Hibernate OFF)
    make "something.bat" file
    copy "@echo off
    rundll32.exe powrprof.dll,SetSuspendState 0,0,1"
    without quotes and then make your shortcut for something.bat file...
    This is 100% fast real sleep for windows 7

    anonymous Says:
    March 02nd, 2011

    but via start menu>shutdown> sleep key works fine wether or not hibernation is on or off. How does it work? I don't wanna turn hibernation off.

    anonymous Says:
    March 16th, 2011

    www.vistax64.com/tutorials/165412-sleep-shortcut.html
    will work.

    anonymous Says:
    April 23rd, 2011

    Create a batch file with the following:

    @echo off
    powercfg -h off
    rundll32.exe powrprof.dll,SetSuspendState 0,0,1
    powercfg -h on

    Then create the desktop shortcut and use the Browse to point to it.

    and then create the desktop shortcut and use the Browse to point to it.

    in my case, with the following keyboard shortcut Ctrl + F1

    Works 100% in Windows 7

    Good luck, bye. Nacho

    avatar

    david Says:
    April 24th, 2011

    I have recently checked since the Windows 7 SP1 update and all the above commands are still in the works. I would even go as so far to believe these commands for restart, shutdown, and sleep will also work on Windows 8.

    anonymous Says:
    November 21st, 2011

    Via start menu>shutdown> sleep key works fine.
    Hibernate is off but command rundll32.exe powrprof.dll,SetSuspendState 0,1,0
    or rundll32.exe powrprof.dll,SetSuspendState Sleep not working.
    Batch file not working "You do not have permission to enable or disable the Hibernate feature." I love Mac

    anonymous Says:
    December 10th, 2011

    That batch file fix works for me. Sleep desktop shortcut kept making my computer to hibernate.

    anonymous Says:
    December 10th, 2011

    good informatiaon ti practice.....because I have looked for it

    Leave a Reply


    ReCaptcha:

    Posting as anonymous Anonymous guest, why not register, or login now.

    Image Gallery

    Badges

    Amazon Wishlist Stumble Upon Toolbar
    Internet Blogs - Blog Top Sites Internet Blogs - Blog Top Sites Technology

    About Me

    avatar

    @davidpolanco
    iPhone: 29.513522,-98.565523 Web Designer, Open Source, Loyal, Dad. Learn more...