Tuesday 1 July 2014

Shut down Windows 8 from the keyboard


Shut down Windows 8 by just pressing a key on your keyboard, pressing a button on your computer, or closing the lid on your laptop.



Using a shortcut

Since not everyone has a keyboard with programmable hot keys, I'll start with the shortcut method. In the article about integrating a Shut Down menu into the Desktop context menu, I showed you a table containing eight command lines that perform all the options typically associated with terminating an active session. For your convenience, these eight command lines are shown in Table A.

Table A: Command lines that perform all the options typically associated with terminating an active session

Command
Command line
RestartShutdown -r -f -t 00
Shut DownShutdown -s -f -t 00
Hybrid Shut DownShutdown -s -f -t 00 -hybrid
SleepRundll32.exe powrprof.dll,SetSuspendState Sleep
HibernateShutdown -h
LockRundll32 User32.dll,LockWorkStation
Sign OffShutdown -l
Switch UsersTsdiscon.exe
While you can use any or all of those command lines with this technique, I'll just stick with the Shut Down command for this example. So, if you right-click on the Desktop and select the New | Shortcut command, you can create a shortcut using Shut Down command line, as shown inFigure A.


Figure A

When the Create Shortcut wizard prompts you, enter the command line to shut down window.
Once you have created the shortcut, right-click on it and select the Properties command. When you see the Properties dialog box, select the Shortcut key text box and press the key(s) that you want to use to shut down your Windows 8 system. Of course, you'll want to use an odd keystroke combination that won't interfere with other existing keyboard shortcuts and will not be easy to accidentally press. As you can see in Figure B, I have used [Ctrl] + [F12].

Figure B

undefined
You'll want to use an odd keystroke combination that won't interfere with other keyboard shortcuts.

No comments:

Post a Comment