How to create shortcuts for Shutdown, Restart, Sleep, Hibernate, Lock, Log Off, Switch Users in Windows

How to create shortcuts for Shutdown, Restart, Sleep, Hibernate, Lock, Log Off, Switch Users in Windows

by Mihai Neacsu on 21 October 2015 · 13284 views

In this tutorial, we are going to cover how to create shortcuts for putting the PC to sleep, hibernate, shutdown, restart, lock, log off, and switch users. These shortcuts can then be place on your Taskbar or Start menu for easier access. The end result will look like this:

1 full How to create shortcuts for Shutdown Restart Sleep Hibernate Lock Log Off Switch Users in Windows

Shortcuts on a Windows 10 desktop

Creating a shortcut for anything in Windows is pretty easy. Here's the step by step guide for this case:

Step 1.

Right-click in an empty area on your desktop and choose New > Shortcut. In the location field, enter one of the following lines for the action you need:

Shutdown Computer Shortcut

Shutdown.exe /s /t 00

The -t 00 part means the PC will begin the shutdown procedure immediately. If you don't specify -t 00 and simply use Shutdown.exe -s, shutdown will start after 30 seconds. Skip to step 2.

Hybrid Shutdown Computer Shortcut

Shutdown.exe /s /hybrid /t 00

This will prepare the computer for a fast startup. Read more about fast startup or hybrid mode. Skip to step 2.

Restart Computer Shortcut

Shutdown.exe /r /t 00

Skip to step 2

Lock Computer Shortcut

Rundll32.exe User32.dll,LockWorkStation

Side tip: You can also do this by pressing Win+L on your keyboard. The lock screen state keeps the user logged in, with all opened apps still running in the background.

Skip to step 2.

Log Off Current User (Sign Out) Shortcut

Shutdown.exe /l

Skip to step 2

Switch User Shortcut

tsdiscon.exe

Skip to step 2

Hibernate Computer Shortcut

shutdown.exe /h

For this to work, Hibernate must be enabled. To enable Hibernate, open an elevated command prompt and type powercfg -h on, then press Enter. (Full tutorial on enabling and disabling hibernate). Skip to step 2

Sleep Computer Shortcut

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

For this Sleep shortcut to work, you must have Hibernation disabled. Otherwise, with Hibernation enabled, this shortcut will just put the PC into hibernation, not into sleep mode. To disable Hibernation, open an elevated command prompt and type powercfg -h off, then press Enter.

If you want to keep Hibernation enabled, but also have an option to put the PC to sleep, you can use PsShutdown, which is included in the PsTools suite. Extract psshutdown.exe from the PsTools archive to a location of your choice, for example to C:\PsTools\psshutdown.exe. Then, create the following shortcut:

C:\PsTools\psshutdown.exe -d -t 0 -accepteula

Replace the path above with the location where you extracted psshutdown.exe.

Using this shortcut will put the PC to sleep regardless of Hibernation being enabled or disabled.

Bonus

For the shortcuts above using shutdown.exe you can add a custom message that will appear on your screen. This can be easily done using the /c parameter.

Example:

C:\Windows\System32\shutdown.exe /s /t 20 /c "PC shuts down in less than 20 seconds. Use the Abort shortcut from desktop, if you change your mind."

Since we mentioned an abort command, you can create a shortcut to abort any of the commands above that are using shutdown.exe, provided that you specify a time parameter /t big enough so you'll have time to hit the Abort shortcut. The abort shortcut is simply:

C:\Windows\System32\shutdown.exe /a

Step 2.

Click Next, name your shortcut and click Finish.

Step 3.

Repeat step 1 and 2 for each shortcut you need.

Customizing the icons for these shortcuts

You can right-click each shortcut, choose Properties, then click Change Icon and browse for an icon of your choice. For instance, you can find .ico files over at www.iconfinder.com.

In Win 8/10, you can right-click the shortcuts and pin them to Taskbar or Start screen. Below is an example of the shortcuts pinned to the Start Screen in Windows 8.1.

2 full How to create shortcuts for Shutdown Restart Sleep Hibernate Lock Log Off Switch Users in Windows

Shortcuts pinned to the Start Screen in Windows 8.1

Tip: Use your keyboard in Windows 8 and 10 to faster shutdown, restart, sleep, or hibernate your PC.

That's it. Leave a comment if you have questions or want to share your experience with customizing the shutdown sequence of your PC.

Comments (0)
Featured Articles