Create Shutdown / Restart / Sleep Shortcuts in Windows 7 or Vista



This video will show you how to create a desktop shortcuts and sleep/shutdown and reset windows 7 and Vista

Shutdown Computer Shortcut
——————————————-
Shutdown.exe -s -t 00

Restart Computer Shortcut
————————————–
Shutdown.exe -r -t 00

Sleep Computer Batch File
————————————–
powercfg -hibernate off
rundll32.exe powrprof.dll,SetSuspendState 0,1,0

My bad the sleep command appears to trigger hibernation. I think the work around for this is to disable hibernation in the registry.
HKEY_LOCAL_MACHINESYSTEMCurr­entControlSetControlPower
In the right pane of the Power key, double click/tap on HibernateEnabled, Type in 0 (zero), and click/tap on OK.
bit of a hack…I think this works. Can’t see another way around it….

Nguồn: https://hargabaru.net/

Xem thêm bài viết khác: https://hargabaru.net/tong-hop/

32 Comments

  • If a keyboard doesn't have, Sleep, Wake up, Power, function keys, can we activate those 3 functions, using "Combination of keys" on keyboard. If yes, let's know, how. please reply to this message. Thanks.

    ourfulltube
    Posted June 29, 2020
  • My sleep icon is work but i can't change the icon! 🙁 (WIN 10)

    Molnár Csongor
    Posted June 29, 2020
  • The sleep command is bad kinda, Sleep command is actually wrong and not working,

    Call the sleep command correctly:

    rundll32 powrprof.dll,SetSuspendState 0,1,0

    And done.

    Try this one if it works or not.

    Oh well.

    Aslı Aslı
    Posted June 29, 2020
  • i made a special icon for it 🙂

    Just a Programmer
    Posted June 29, 2020
  • Big thanks.. quick and straight forward to the point.. Love it!!! thanks for keeping the video posted

    MEGA NZ
    Posted June 29, 2020
  • a vry big thnx to u sir frm the bttm of my hrt

    Nafis Abraar
    Posted June 29, 2020
  • how to work

    Sumathi. Devara
    Posted June 29, 2020
  • Worked for me thank you

    RossB_Vk3nrb
    Posted June 29, 2020
  • Is the one that he used same as shutdown /s /t 0 (for shutdown)?

    空白の声
    Posted June 29, 2020
  • but the botton of shutdown does not work

    abdilahi Sulub
    Posted June 29, 2020
  • Right click on the sleep.bat file and then click properties and then check the hidden property of the file

    Barrett Ross
    Posted June 29, 2020
  • work for windows 10 ?

    Yuki 64
    Posted June 29, 2020
  • Reastart don work ….

    Pyro
    Posted June 29, 2020
  • anyone can do this, i need a keyboard button assigned, cos if my mame crashes i dont have a button to press on my pitiful keyboard

    Cool Coyote
    Posted June 29, 2020
  • signed in just to like this, thanks alot man..

    Sachin Rapper
    Posted June 29, 2020
  • 「shutdown.exe -s -t 00」for SHUTDOWN 「shutdown.exe -r -t 00」for RESET 「rundll32.exe powrprof.dll,SetSuspendState 0,1,0」 for SLEEP

    KS Lee
    Posted June 29, 2020
  • for your sleep shortcut it will show your text file instead of putring your computer into sleep make your shortcut type the command 「rundll32.exe SetSuspendState 0,1,0」

    KS Lee
    Posted June 29, 2020
  • but your shutdown shortcut icon is still right =)

    KS Lee
    Posted June 29, 2020
  • You have use the icon what that has the right-arrow in a green square for the Restart shortcut and have to put the sleep shortcut's icon you have to put the icon that has the thing looks like a disk eject symbol in a golden square xD

    KS Lee
    Posted June 29, 2020
  • Soo helpful 😀 thanks

    Kieran Smith
    Posted June 29, 2020
  • This code also works when you type it in the shortcut wizard. but you have to turn off the powercfg -h off on the cmd as administrator:
    rundll32.exe powrprof.dll,SetSuspendState, 0,1,0

    Carlos Bermudez
    Posted June 29, 2020
  • Thank you for the tip for setting the registry to avoid hibernation. I turned off hibernation with the Control Panel Power settings, but the "rundll32.exe powrprof.dll,SetSuspendState 0,1,0" still went to hibernation. I also changed the Properties of the Start Menu power button to Sleep.

    originalfred66
    Posted June 29, 2020
  • worked fine for me .. thanks 😉

    cBooM
    Posted June 29, 2020
  • Kinda wrong. Your Sleep shortcut will ONLY do what you have your power button set as. IE: Right-click start button / Properties set "Power Button Action:" to Sleep. Or just add a shortcut like [C:WindowsSystem32rundll32.exe Powrprof.dll,SetSuspendState Sleep]

    Bill Evlogs
    Posted June 29, 2020
  • Thanks for replying, but had you actually tried this? It does not work for me.

    fretsman68
    Posted June 29, 2020
  • Sorry Guys, my bad the sleep command appears to trigger hibernation. I think the work around for this is to disable hibernation in the registry.

    HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlPower

    In the right pane of the Power key, double click/tap on HibernateEnabled, Type in 0 (zero), and click/tap on OK.

    bit of a hack…I think this works. Can't see another way around it….

    TechieHowTo
    Posted June 29, 2020
  • I have the same problem :/ Can't find a solution for it.

    TimAussiex
    Posted June 29, 2020
  • nothing yet?

    fretsman68
    Posted June 29, 2020
  • Unfortunately the sleep mode is more of a hibernate, correct?
    I've tried this and it can't wake up by just hitting the mouse or keyboard button like when using the sleep command in the orb/shut-down menu . I actually have to hit the power button and then it goes through the whole bios screen to wake up.
    Do you have a function for the sleep command like on the windows shutdown menu?
    Thanks,
    Dave

    fretsman68
    Posted June 29, 2020
  • Wow thanks !
    Also in the sleep shortcut icon, you can add a keyboard shortcut like ctrl+shift+S
    This makes it that much more easier than to use the mouse to double click it, and you can safely hide the batch file and shortcut somewhere else.

    Daedalus
    Posted June 29, 2020
  • thanks so much bro!! genius

    Renaissander
    Posted June 29, 2020
  • great! thanks.

    Mohamad Toha
    Posted June 29, 2020

Leave a comment