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
|Restart||Shutdown -r -f -t 00|
|Shut Down||Shutdown -s -f -t 00|
|Hybrid Shut Down||Shutdown -s -f -t 00 -hybrid|
|Sleep||Rundll32.exe powrprof.dll,SetSuspendState Sleep|
|Sign Off||Shutdown -l|
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.
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].
You’ll want to use an odd keystroke combination that won’t interfere with other keyboard shortcuts.
Using a keyboard with programmable hot keys
After launching the Microsoft Mouse and Keyboard Center, I accessed the keyboard section’s basic settings, located My Favorites, and typed in the command lines to initiate my chosen options, as shown in Figure C. Now, in addition to shutting down my Windows 8 system from
the keyboard, I can restart it, put it into hibernation, sign off, or switch users. (I later affixedcustom stickers to those keys to help me remember which key was which.)
The Microsoft Mouse and Keyboard Center makes it easy to configure these keys to shut down Windows 8.
Using the PC’s power button
Most folks don’t associate pressing the power button on a PC with a controlled shut down procedure, because in the old days doing so would just turn off the power – akin to pulling the plug of a running PC. However, pressing the Power button on the front of your PC will initiate the exact same procedure as selecting Shut down from Windows 8’s Power Charm, as illustrated in Figure D.
Pressing the Power button is the same as selecting the Shut down command.
Now, if you would rather have the Power button perform another operation, such as put Windows 8 to sleep or into hibernation mode, you can do so from the Power Options tool. To immediately access the Power button settings in the Power Options tool, use the [Windows] + W keystroke to access the Search Settings page. Then, type Power button in the text box and click the Change what the power buttons do item, as shown in Figure E.
You can quickly access the Power button configuration options from the Search Settings page.
Alternatively, you can move your mouse pointer to the lower left corner of the screen and when the Start Screen button pops up, right click to display the WinX menu. You can then select the Power Options command. When the Power Options window appears, select the Choose what the power button does command. This process is illustrated in Figure F.
From the Power Options window, select Choose what the power buttons do.
When you get to the System Settings page, locate the Power button settings section and you’ll see that the option is already configured for Shut down, as shown in Figure G.
By default, the Power button settings should be configured as Shut down.
Now, if you don’t want the Power button to shut down the system, you can click the drop down arrow in the Power button settings section and select one of the other options, such as Hibernate or Sleep, as shown in Figure H. Once you make a change, just click the Save changes button and then close the Power Options window.
In addition to Shut down, you can configure the power button to put the system to sleep or into hibernation.
Using a Sleep button
There are actually quite a few keyboards out there that have a Sleep button on them, like the keyboard shown in Figure I. As you can imagine, the Sleep button is automatically configured to put your Windows 8 system into Sleep mode.
Many keyboards have a Sleep button.
When you access the System Settings page on a system with such a keyboard, you’ll find that the section is titled Power and sleep button settings. If you click the drop down menu, you can also choose Hibernate, as shown in Figure J.
The System Settings page allows you to reconfigure the Sleep button.
Closing the lid
On a laptop, you have one more option for terminating an active session – closing the lid. When you access the System Settings page on a laptop, you’ll find that the section is titled Power and sleep buttons and lid settings. As you can see in Figure K, on this particular laptop, I have configured the When I close the lid setting to be a Shut Down operation when on battery and a Hibernate operation when plugged into AC power.