Customizing Your Notebook’s Power and Sleep Buttons

Most newer notebooks enable you to configure three “power buttons” closing the lid, using the on/off button, and using the sleep button. When you activate these buttons, they put your system into sleep mode, hibernate mode, or turn it off altogether. On some notebooks, there isn’t a separate sleep button; you simply tap the on/off button quickly.
To configure these buttons for power management in Windows 7, follow these steps:
1. Click Start, type power options, and then press Enter. The Power Options window appears.
2. Click the Choose What the Power Buttons Do link to see the System Settings
window.
3. Use the lists to configure the power button, sleep button, and lid switch for battery power and AC power.
4. Click Save Changes.

TIP
By default, Windows 7 disables the options in the Password Protection on Wakeup group. This means that you always have to enter your user account password when Windows 7 wakes from sleep mode. If you prefer not to enter your password each time, you can enable these options by clicking the Change Settings That Are Currently Unavailable link, and then clicking the Don’t Require a Password option.

Customizing the Start Menu’s Power Button

I criticized the Windows 7 shut down procedure earlier, but I’ll admit it’s a bit of an improvement over Vista (which required three clicks to shut down) and it’s a lot better than XP (which required as many as four clicks). However, what if you rarely shut down your PC? For example, many people prefer to put their computer into sleep mode rather than shutting it down altogether. Similarly, you may find that you lock your computer or switch users far more often than you shut down.

Unfortunately, choosing the Sleep, Lock, and Switch User commands in Windows 7 requires three annoying clicks (click Start, click the arrow beside Shut Down, and then click your command). Fortunately, the Windows 7 programmers have taken pity on us and made the power button (the Start menu button that says Shut Down by default) fully customizable, meaning that you can replace the Shut Down command with any of the following: Lock, Log Off, Restart, Sleep, or Switch User. Nice!
Here are the steps to follow:
1. Click Start.
2. Right-click the power button and then click Properties. Windows 7 displays the Taskbar and Start Menu Properties dialog box with the Start Menu tab displayed.
3. Use the Power Button Action list to choose the command you want to see on the power button.
4. Click OK.

Turning Off Your Windows 7 Computer from Anywhere

If you’re working at a network computer and you decide you need to shut down or restart your own PC, you can actually do it from your remote location on the network.

NOTE
The technique in this section works with Windows 7, but only if the Windows 7 PC has User Account Control turned off. Personally, I think the security of UAC immensely outweighs the convenience of a remote shutdown, so I highly recommend leaving UAC alone and skipping this tweak for your Windows 7 PC. As a workaround, set up your Windows 7 machine as a Remote Desktop host which enables you to connect to the PC over the network and shut it down manually from there.
To shut down a remote computer, you must run SHUTDOWN using an account that has administrator privileges on the remote computer. If the logged on user account on your local machine also exists on the remote machine and is a member of the Administrators group, you automatically have sufficient privileges to shut down the remote PC.
You do this by running SHUTDOWN with the following general syntax:
shutdown /s /m \\ComputerName

Here, ComputerName is the name of the remote PC. For example, the following command
shuts down a remote PC named GAMINGPC:
shutdown /s /m \\gamingpc
If the local account you’re logged on with does not exist on the remote computer, or if it
does exist but doesn’t have administrator rights, you need to run the SHUTDOWN command
using a remote administrator account. This requires you to use the RUNAS command-line
tool:
RUNAS /user:ComputerName\UserName cmd
ComputerName
UserName
cmd

The name of the remote computer
The name of the account under which you want to run cmd
The command you want to run
For a remote shutdown, UserName will be a remote administrator-level account, and cmd
will be the SHUTDOWN command, enclosed in quotation marks. Here’s an example that uses
an account named Paul to shut down a remote computer named OFFICEPC in 120
seconds:
runas /user:officepc\paul “shutdown /s /m \\officepc /t 120”

When you enter the RUNAS command, Windows prompts you for the account password:
Enter the password for officepc\paul:
Type the password (it doesn’t appear onscreen) and press Enter.
TIP
If you need to embed a quotation mark in the cmd portion of RUNAS, precede it with a backslash (\). Here’s an example:
runas /user:officepc\paul “shutdown /s /m \\officepc /c \”Comment\””
If you need to cancel a pending shutdown on a remote computer, run SHUTDOWN with the
/A switch before the timeout interval is over:
runas /user:officepc\paul “shutdown /a /m \\officepc”

Create a Shutdown Shortcut

I think you know what comes next, right? Follow these very similar steps to add a shutdown shortcut to the Quick Launch toolbar:
1. Right-click an empty section of the desktop, and then select New, Shortcut. The Create Shortcut Wizard appears.
2. In the text box, type shutdown /s /t 0.
3. Click Next. The Create Shortcut wizard prompts you to enter a name for the shortcut.
4. Type a name (such as The Amazing One-Click Shutdown Whatsit) and then click Finish.
5. Right-click the new shortcut and then click Properties. The shortcut’s property sheet appears.
6. In the Shortcut tab, click Change Icon. Windows tells you that shutdown.exe contains no icons.
7. Click OK. The Change Icon dialog box appears.
8. Click an icon that looks “shutdown-y” and then click OK.
9. Click OK. Windows applies the new icon to the shortcut.
10. Right-click the shortcut and then click Pin to Taskbar. Windows 7 adds your icon to the taskbar, and restarts are now just a click away.

Create a Restart Shortcut

Okay, let’s use our newfound knowledge of the SHUTDOWN command to set up Windows 7 with one-click restarts:
1. Right-click an empty section of the desktop, and then select New, Shortcut. The Create Shortcut Wizard appears.
2. In the text box, type shutdown /r /t 0
3. Click Next. The Create Shortcut wizard prompts you to enter a name for the shortcut.
4. Type a name (such as The Amazing One-Click Restart Thingy) and then click
Finish.
5. Right-click the new shortcut and then click Properties. The shortcut’s property sheet appears.
6. In the Shortcut tab, click Change Icon. Windows tells you that shutdown.exe contains no icons.
7. Click OK. The Change Icon dialog box appears.
8. Click an icon that looks “restart-y” and then click OK.
9. Click OK. Windows applies the new icon to the shortcut.
10. Right-click the shortcut and then click Pin to Taskbar. Windows 7 adds your icon to the taskbar, and restarts are now just a click away.

Setting Up an Automatic Logon

If you’re using a standalone computer that no one else has access to (or that will be used by people you trust), you can save some time at startup by not having to type a username and password. In this scenario, the easiest way to do this is to set up Windows 7 with just a single user account without a password, which means Windows 7 logs on that user automatically at startup. If you have multiple user accounts (for testing purposes, for example)
or if you want the Administrator account to be logged on automatically, you need to set up Windows 7 for automatic logons.

CAUTION
Setting up an automatic logon is generally not a good idea for notebook computers because they’re easily lost or stolen. By leaving the logon prompt in place, the person who finds or steals your notebook will at least be unlikely to get past the logon, so your data won’t be compromised.
Follow these steps:
1. Select Start, type control userpasswords2, press Enter, and then enter your UAC credentials. The User Accounts dialog box appears.
2. Display the Users tab.
3. Click your username (or the name of whichever user you want to automatically log on).
4. Deactivate the Users Must Enter a User Name and Password to Use this Computer check box.
5. Click OK. The Automatically Log On dialog box appears. The username you clicked in step 3 is filled in automatically.
6. Type the user’s password into the Password and Confirm Password text boxes.
7. Click OK.
The next time you start your PC, Windows logs on your account automatically.

TIP

If you have other accounts on your system, you can still log on one of them at startup if need be. Restart your computer and, after the various BIOS messages are done, press and hold the Shift key. This tells Windows to bypass the automatic logon and display the logon screen.

Disabling Automatic Logon Override
As you saw in the Tip sidebar in the preceding section, you can hold down the Shift key to override an automatic logon. In some situations, this is not preferable. For example, you might have a computer set up for a particular user and you want only that user to log on. In that case, you don’t want the user overriding the automatic logon.
To prevent the override of an automatic logon using the Shift key, open the Registry Editor once again and navigate to the following key:
HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\
Create a new String value named IgnoreShiftOverride and set its value to 1.

Useful Windows 7 Logon Strategies

The default Windows 7 logon is fine for most users, but there are many ways to change
Windows 7’s logon behavior. This section offers up a few tips and techniques for altering
the way you log on to Windows 7.
Logging On to a Domain
In versions of Windows prior to Vista, when you logged on to a domain you always used
the Classic Windows logon, which consisted of pressing Ctrl+Alt+Delete and then typing
your username and password in the Log On to Windows dialog box. (You also had the
option of specifying a different domain.) However, the Classic Windows logon was
removed from Vista and remains gone from Windows 7. To log on to a domain in
Windows 7, you must specify the domain as part of the username. You have two choices:
. NetBIOSName\UserName—Here, replace NetBIOSName with the NetBIOS name of
the domain, and replace UserName with your network username (for example,
logophilia\paulm).
. UserName@Domain—Here, replace Domain with the domain name, and replace
UserName with your network username (for example, paulm@logophilia.com).
Enabling the Administrator Account
One of the confusing aspects about Windows 7 is that the Administrator account seems to
disappear after the setup is complete. That’s because, for security reasons, Windows 7
doesn’t give you access to this all-powerful account. I should say it doesn’t give you easy
access to this account. The Welcome screen doesn’t include an option to choose the
Administrator, and no option exists anywhere in the Control Panel’s user account windows
to enable this account to log on.

That’s probably just as well because it keeps most users much safer, but it’s annoying for
those of us who might occasionally require the Administrator account. For example, tools
such as the Windows Automated Installation Kit require that you be logged on with the
Administrator account.
Fortunately, you can activate the Administrator account in several ways. Here’s a quick
look at two of them:
. Using the Local Security Policy Editor—Select Start, type secpol.msc, press
Enter, and then enter your UAC credentials. In the Local Security Policy Editor, open
the Local Policies, Security Options branch, and then double-click the Accounts:
Administrator Account Status policy. Click Enabled, and then click OK.
. Using the Local Users and Groups snap-in—Select Start, type lusrmgr.msc,
press Enter, and then enter your UAC credentials. In the Local Users and Groups
snap-in, click Users and then double-click Administrator. In the Administrator
Properties dialog box, deactivate the Account Is Disabled check box, and then click OK.
These methods suffer from a serious drawback: They don’t work in all versions of
Windows 7, in particular Windows 7 Home Basic and Windows 7 Home Premium.
Fortunately, we haven’t exhausted all the ways to activate Windows 7’s Administrator
account. Here’s a method that works with all versions of Vista:
1. Select Start, type command, right-click Command Prompt, and then click Run as
Administrator. The User Account Control dialog box appears.
2. Enter your UAC credentials to continue.
3. At the command line, enter the following command:
net user Administrator /active:yes
CAUTION
Right now, your freshly activated Administrator account has no password! Log on as the
administrator and immediately use the Control Panel to give the account a strong password.

NOTE
When you’re done with the Administrator account, be sure to disable it again for security. At an Administrator Command Prompt, enter the follow command:
net user Administrator /active:no

With the Administrator account active, it’s a good idea to rename it.

Customizing Startups with the Advanced Options Menu

When the Windows Boot Manager menu appears at startup, you see the following
message when you highlight a Windows 7 install:
To specify an advanced option for this choice, press F8.

If you press F8, you get to the Advanced Boot Options menu, which looks like this:
Advanced Boot Options
Choose Advanced Options for: Microsoft Windows 7
(use the arrow keys to highlight your choice.)
Repair Your Computer
Safe Mode
Safe Mode with Networking
Safe Mode with Command Prompt
Enable Boot Logging
Enable low-resolution video (640×480)
Last Known Good Configuration (advanced)
Directory Services Restore Mode
Debugging Mode
Disable automatic restart on system failure
Disable Driver Signature Enforcement
Start Windows Normally
TIP
If your system doesn’t automatically display the Windows Boot Manager menu at start-
up, you can display it manually. After you start your computer, wait until the POST is
complete, and then press F8 to display the Windows Boot Manager menu. If your com-
puter is set up to “fast boot,” it might not be obvious when the POST ends. In that
case, just turn on your computer and press F8 repeatedly until you see the Windows
Boot Manager menu. Note, however, that if your system picks up two separate F8
presses, you might end up directly in the Advanced Boot Options menu.
The Start Windows Normally option loads Windows 7 in the usual fashion. You can use
the other options to control the rest of the startup procedure:
. Repair Your Computer—This option (it’s new with Windows 7) opens the System
Recovery Options, which enable you to perform a startup repair or system restore,
recover your PC from a system image, and more.
. Safe Mode—If you’re having trouble with Windows 7—for example, if a corrupt or
incorrect video driver is mangling your display, or if Windows 7 won’t start—you
can use the Safe Mode option to run a stripped-down version of Windows 7 that
includes only the minimal set of device drivers that Windows 7 requires to load. You
could reinstall or roll back the offending device driver and then load Windows 7
normally. Starting in Safe mode displays the Administrator account in the Welcome
screen, which is the account to use when troubleshooting problems. When Windows
7 finally loads, the desktop reminds you that you’re in Safe mode by displaying Safe
Mode in each corner. (Also, Windows Help and Support appears with Safe
mode–related information and links.)
NOTE
If you’re curious to know which drivers are loaded during a Safe mode boot, see the
subkeys in the following Registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\
4
. Safe Mode with Networking—This option is identical to plain Safe mode, except
that Windows 7’s networking drivers are also loaded at startup. This enables you to
log on to your network, which is handy if you need to access the network to load a
device driver, run a troubleshooting utility, or send a tech support request. This
option also gives you Internet access if you connect via a gateway on your network.
This is useful if you need to download drivers or contact online tech support.
. Safe Mode with Command Prompt—This option is the same as plain Safe
mode, except that it doesn’t load the Windows 7 GUI. Instead, it runs cmd.exe to
load a Command Prompt session.
. Enable Boot Logging—This option is the same as the Boot Normally option,
except that Windows 7 logs the boot process in a text file named ntbtlog.txt that
resides in the system root.
. Enable Low-Resolution Video (640×480)—This option loads Windows 7 with
the video display set to 640×480 and 256 colors. This is useful if your video output is
garbled when you start Windows 7. For example, if your display settings are config-
ured at a resolution that your video card can’t handle, boot in the low-resolution
mode and then switch to a setting supported by your video card.
. Last Known Good Configuration—This option boots Windows 7 using the last
hardware configuration that produced a successful boot.
. Directory Services Restore Mode—Boots Windows 7 in Safe mode and restores a
backup of the Active Directory service. (This option applies only to domain
controllers.)
. Debugging Mode—Enables remote debugging of the Windows 7 kernel.
. Disable Automatic Restart on System Failure—Prevents Windows 7 from
restarting automatically when the system crashes. Choose this option if you want to
prevent your system from restarting so that you can read an error message or deduce
other information that can help you troubleshoot the problem.
. Disable Driver Signature Enforcement—Prevents Windows 7 from checking
whether devices drivers have digital signatures. Choose this option to ensure that Windows 7 loads an unsigned driver, if failing to load that driver is causing system problems.

Using the System Configuration Utility to Modify the BCD

For more detailed control over the BCD store, you can modify the data by using the
System Configuration Utility. To start this program, follow these steps:
1. Select Start, type msconfig, and then press Enter. The System Configuration Utility
window appears.
2. Select the Boot tab.

The large box near the top of the tab displays the Windows 7 installations on the current
computer. You see Current OS beside the Windows 7 installation you are running now;
you see Default OS beside the Windows 7 installation that is set up as the default. There
are four main tasks you can perform:
. Click the Set as Default button to set the highlighted Windows 7 install as the
default for the Windows Boot Manager menu.
. Use the Timeout text box to set the maximum time that Windows Boot Manager
waits before selecting the default OS.

. Use the check boxes in the Boot Options group to set the following startup options
for the currently highlighted Windows 7 install:
Safe Boot: Minimal—Boots Windows 7 in Safe mode, which uses only a minimal set of
device drivers. Use this switch if Windows 7 won’t start, if a device or program is causing
Windows 7 to crash, or if you can’t uninstall a program while Windows 7 is running normally.
Safe Boot: Minimal (Alternate Shell)—Boots Windows 7 in Safe mode but also bypasses
the Windows 7 GUI and boots to the Command Prompt instead. Use this switch if the
programs you need to repair a problem can be run from the Command Prompt or if you
can’t load the Windows 7 GUI.
NOTE
The shell loaded by the /safeboot:minimal(alternateshell) switch is determined
by the value in the following Registry key:
4
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\SafeBoot\AlternateShell
The default value is cmd.exe (the Command Prompt).
Safe Boot: Active Directory Repair—Boots Windows 7 in Safe mode and restores a
backup of the Active Directory service. (This option applies only to domain controllers.)
Safe Boot: Network—Boots Windows 7 in Safe mode but also includes networking
drivers. Use this switch if the drivers or programs you need to repair a problem exist on a
shared network resource, if you need access to email or other network-based communica-
tions for technical support, or if your computer is running a shared Windows 7 installation.
No GUI Boot—Tells Windows 7 not to load the VGA display driver that is normally used to
display the progress bar during startup. Use this switch if Windows 7 hangs while switch-
ing video modes for the progress bar, or if the display of the progress bar is garbled.
Boot Log—Boots Windows 7 and logs the boot process to a text file named ntbtlog.txt
that resides in the %SystemRoot% folder. Move to the end of the file and you might see a
message telling you which device driver failed. You probably need to reinstall or roll back the
driver. Use this switch if the Windows 7 startup
hangs, if you need a detailed record of the startup process, or if you suspect (after using
one of the other Startup menu options) that a driver is causing Windows 7 startup to fail.

NOTE
%SystemRoot% refers to the folder into which Windows 7 was installed. This is usually
C:\Windows.
Base Video—Boots Windows 7 using the standard VGA mode: 640×480 with 256 colors.
This is useful for troubleshooting video display driver problems. Use this switch if Windows
7 fails to start using any of the Safe mode options, if you recently installed a new video card
device driver and the screen is garbled, the driver is balking at a resolution or color depth
setting that’s too high, or if you can’t load the Windows 7 GUI. After Windows 7 has
loaded, you can reinstall or roll back the driver, or you can adjust the display settings to
values that the driver can handle.
OS Boot Information—Displays the path and location of each device driver as it loads, as
well as the operating system version and build number, the number of processors, the
system memory, and the process type.
. Click the Advanced Options button to display the BOOT Advanced Options dialog box.You can set the following options:
Number of Processors—In a multiprocessor system, specifies the maximum of processors
that Windows 7 can use. Activate this check box if you suspect that using multiple proces-
sors is causing a program to hang.
Maximum Memory—Specifies the maximum amount of memory, in megabytes, that
Windows 7 can use. Use this value when you suspect a faulty memory chip might be
causing problems.
PCI Lock—Activate this check box to tell Windows 7 not to dynamically assign hardware
resources for PCI devices during startup. The resources assigned by the BIOS during the
POST are locked in place. Use this switch if installing a PCI device causes the system to
hang during startup.
Detect HAL—Activate this check box to force Windows 7 to detect the computer’s
hardware abstraction layer (HAL) at startup. The HAL is a software layer that resides
between the computer’s hardware and the operating system kernel, and its job is to hide
hardware differences so that the kernel can run on a variety of hardware. If you force
Windows 7 to detect the HAL, it can use the HAL to interact with the computer’s hardware
at startup. This is useful if dealing with the hardware directly is causing startup problems.
Debug—Enables remote debugging of the Windows 7 kernel. This sends debugging informa-
tion to a remote computer via one of your computer’s ports. If you use this switch, you can
use the Debug Port list to specify a serial port, IEEE 1394 port, or USB port. If you use a
serial port, you can specify the transmission speed of the debugging information using the
Baud Rate list; if you use an IEEE 1394 connection, activate Channel and specify a channel
value; if you use a USB port, type the device name in the USB Target Name text box.

Using Startup and Recovery to Modify the BCD

You can modify a limited set of BCD options using the Startup and Recovery dialog box:
the default operating system, the maximum time the Windows Boot Manager menu is
displayed, and the maximum time the Windows 7 startup recovery options are displayed.
Here are the steps to follow:
1. Select Start, right-click Computer, and then click Properties. Windows 7 displays
Control Panel’s System window.
2. Click Advanced System Settings. The System Properties dialog box appears.
TIP
Another way to get to the System Properties dialog box is to select Start, type
systempropertiesadvanced, and then press Enter.
4
3. In the Advanced tab, click the Settings button in the Startup and Recovery group.
Windows 7 displays the Startup and Recovery dialog box.
4. Use the Default Operating System list to click the operating system that Windows
Boot Manager highlights by default at startup. (In other words, this is the operating
system that runs automatically if you do not make a choice in the Windows Boot
Manager menu.)
5. Use the Time to Display List of Operating Systems spin box to set the interval after
which Windows Boot Manager launches the default operating system. If you don’t
want Windows Boot Manager to select an operating system automatically, deactivate
the Time to Display List of Operating Systems check box.
6. If Windows 7 is not shut down properly, Windows Boot Manager displays a menu of
recovery options at startup. If you want the default options selected automatically
after a time interval, activate the Time to Display Recovery Options When Needed
check box and use the associated spin box to set the interval.
7. Click OK in all open dialog boxes to put the new settings into effect.