Create Shutdown, Restart, Hibernate and Sleep Shortcuts in Windows 10

In Windows 10, you can use various methods to shutdown, restart, hibernate or sleep the operating system. However, if you need to create a shortcut to perform one of these actions directly, the operating system does not provide you such an option. You need to create such shortcuts manually, using a special set of commands. Here is how it can be done.


Windows 10 power shortcut banner Before you continue, you might be interested in knowing that it is possible to create a shortcut for the good old classic Shut Down Windows dialog. We showed you how it can be done here:
How to create a shortcut to the Shut Down Windows dialog in Windows 10

Create Shutdown Shortcut in Windows 10

  1. Right click the Desktop and select New - Shortcut. Windows 10 new - shortcut
  2. In the shortcut target box, type or copy-paste the following command:
    shutdown /s /t 0

    See the following screenshot: Windows 10 shutdown shortcut

  3. Set the desired icon and name for your shortcut. Windows 10 shutdown shortcut name Windows 10 shutdown shortcut icon

By default, the shutdown /s /t 0 command will perform a full shutdown. This means that the fast startup feature will not be used the next time you start your computer. If you are using Fast Startup, you should modify the shutdown command and add the /hybrid switch as follows:

shutdown /s /hybrid /t 0

Windows 10 shutdown shortcut hybrid

Create Restart Shortcut in Windows 10
To create a shortcut to restart Windows 10, use the shutdown /r /t 0 command as follows:

  1. Right click the Desktop and select New - Shortcut. Windows 10 new - shortcut
  2. In the shortcut target box, type or copy-paste the following command:
    shutdown /r /t 0

    See the following screenshot: Windows 10 restart shortcut

  3. Set the desired icon and name for your shortcut. Windows 10 restart shortcut name Windows 10 restart shortcut icon

Sleep Shortcut for Windows 10
The command to put the computer to sleep is as follows:

rundll32.exe powrprof.dll,SetSuspendState 0,1,0

However, if you have hibernation enabled, which is on by default on most computers, the command will put your PC into hibernation instead. I explained this in detail here: How to sleep Windows 10 from the command line.
So, you can create a batch file "sleep.cmd" with the following contents:

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

Windows 10 sleep batch

In the example above, I've used the powercfg command to disable hibernation, just before using the Rundll32 command. Then the rundll32 command will work correctly and put the PC to sleep.

Let's assume that you saved the batch file to the folder c:\apps. Then you create a shortcut to put Windows 10 to sleep this way:

  1. Right click the Desktop and select New - Shortcut. Windows 10 new - shortcut
  2. In the shortcut target box, type or copy-paste the following command:
    c:\apps\sleep.cmd

    Correct the file path according to your preferences.

  3. Set the desired icon and name for your shortcut. Windows 10 sleep shortcut

Hibernate Shortcut for Windows 10
As mentioned above, when hibernation is enabled, the same command hibernates your PC so create the following batch file:

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

Windows 10 hibernate batch It will enable hibernation if it was disabled and then hibernate your Windows 10 PC.
Save it, for example, as c:\apps\hibernation.cmd
Then create a shortcut to this file. Windows 10 hibernate shortcut

Here are additional articles you might be interested in:

That's it. If you have a question or suggestions, you are welcome to comment.

14 thoughts on “Create Shutdown, Restart, Hibernate and Sleep Shortcuts in Windows 10

  1. Josee

    Is it possible too to get a specific drive in hibernate? e.g. drive D: ?

    Reply
    1. Sergey Tkachenko Post author

      A drive for what? For the hiberfil.sys file?

      Reply
  2. David

    The .bat file puts my computer into hibernation….what now???

    Reply
  3. Kevin

    Hello:

    I have hibernation enabled. I followed the instructions to create a sleep button when hibernation is enabled.

    When I click on the button my computer hibernates.

    Reply
    1. Taufik Naaim

      I have the same problem

      Reply
      1. yak

        I have the same problem. It helped a lot:
        I create plik .bat (not .cmd):

        powercfg -h off & start /min “” C:\WINDOWS\System32\rundll32.exe PowrProf.dll,SetSuspendState 0,1,0 & ping -n 4 127.0.0.1 > nul & powercfg -h on

        It’s not professional, but it works :)

        Reply
        1. Joy

          No matter what command I use, no matter what variation, every sleep command causes my W10 computer to hibernate, even though I have hibernation disabled.

          Reply
          1. Mmm

            For those who have same problem.
            powercfg -hibernate off should be run as administrator.

  4. Adnan

    Shutdown and restart shortcuts FORCE windows to shutdown, therefore all running apps don’t get time to save their data properly, for eg: Utorrent is force closed therefore when i start the pc, it re-calculate all the torrents even completed torrents too, which is a bit nuisance.

    So is there any shirtcut available to normally shutdown/restart/logg off/lock windows pc?

    Reply
    1. Sergey Tkachenko Post author

      Hello.
      The shutdown is forced when you specify the /f switch. Ensure that you have no /f switch added to the shutdown command.
      Also, you may try to change the /t argument value. Let’s say, change it to /t 5.

      Reply
  5. lem

    Sleep command does nothing on my w10 .
    tried with a cmd file also.
    rundll32.exe powrprof.dll,SetSuspendState 0,1,0
    Does nothing . Any suggestions ?

    Reply
  6. nacci

    Is there any way possible to add a confirmation before shutdown?
    Because, I have pinned your shortcut in the task-bar and sometimes it shuts down directly.
    It would be nice if get a chance to press enter key after pressing the shortcut to proceed with the shutdown.
    Kindly say if there is any solution..
    thanks!

    Reply
    1. Sergey Tkachenko Post author

      Well, the only solution to pin a batch file instead and use a confirmation there.
      Or, you can pin a VBscript file with a message box.
      Please let me know if you need assistance with these ideas.

      Reply
  7. Heather

    i followed this step by step for creating the one click sleep button, but all it does is open the notepad that the code in on. It doesn’t actually run the program. what did i do wrong????

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *