Starting up and shutting down a PC should be easy. Press a button and it turns on; click a few buttons and it turns off. The same holds true for your PC’s system properties. There should be nothing complicated about doing things such as setting the system time or giving your computer a name.
But in computing, as in life, things are not always simple. And so things can get difficult and complicated. What if you sometimes want to start up your PC with debugging turned on, for example, or using safe mode, or using an entirely different operating system? What if you want to hunt down and kill programs and services that cause system conflicts? What if you want to change your boot screen or customize your system sounds?
You’ll find recipes for doing all that and more in this chapter, so that you can take control of startup, shutdown, and setting your system’s properties. For information about troubleshooting startup problems, turn to Chapter 20, Crashes and Errors.
6.1 Automatically Setting the Time on a Domain-Connected PC
Problem
You’re on a PC connected to a domain, and you want the PC to have its clock set to the proper time automatically, without your intervention.
Solution
Using a graphical user interface
At the Run box, type services.msc and press Enter. This will run the services management module.
Scroll down to the Windows Time entry and double-click on it.
From the Startup type drop-down box, choose Automatic, as shown in Figure 6-1. Click OK. From now on, your PC will automatically synchronize its time with the domain controller every time the PC starts. (Note: This setting is turned on by default, but there is a chance that it has been turned off on your system, so it’s a good idea to double-check.)
Figure 6-1.If you're connected to a domain, the Windows Time service will automatically connect to a domain controller to synchronize its clock
Using a command-line interface
At the command line, type net start w32time and press Enter. That will start the Windows Time service. To stop the service, at the command line typenet stop w32timeand press Enter. That will stop the Windows Time service. When you use the command line to start the Windows Time service, the service only runs for that single session. If you want the service to start every time you start XP you can use the service’s management module, or you can use the sc.exe utility (runsc /configfor more information).
Discussion
Only computers running Windows XP Professional can connect to domains, so XP Professional has Windows Time service, while the XP Home Edition does not. By default, the Windows Time service runs automatically on Windows XP Professional computers.
Time synchronization takes place with the Windows Time service during system startup. During startup, the Net Logon service looks for a domain controller that can synchronize time with the PC. It follows the Active Directory hierarchy. When the service finds a domain controller, it sends a request for time and waits for a reply. The communication is an exchange of SNTP packets that calculates the time offset and the roundtrip delay between the two computers.
You can also use the Registry to synchronize a PC’s time with a domain controller on stsartup. Open the Registry Editor, and go to the keyHKEY_LOCAL_MACHINE\SYSTEM\ CurrentControlSet\Services\W32Time\Parameters. Create a REG_SZ value calledTypeand give it the valueNt5DS. That will tell the computer to synchronize its time with a domain controller on startup. If you give it the valueNoSync, it will tell the computer not to synchronize its time with a domain controller.
See Also
For more details about using the Windows Time service, see http://www.microsoft. com/technet/ prodtechnol/winxppro/maintain/xpmanaged/27_xpwts. mspx. For more information about using the Registry and the Windows Time service, see http:// www.winguides.com/registry/display.php/1118.
You’re on a PC that is not connected to a domain, and you want the PC to automatically have its clock set to the proper time without your intervention.
Solution
Using a graphical user interface
Double-click the time on the right side of the Taskbar.
From the Date and Time Properties dialog box that appears, click the Internet Time tab.
Check the box next to Automatically synchronize with an Internet time server (Figure 6-2). You can choose from a list of servers on the Server drop-down box. To synchronize the time immediately, click Update Now.
Figure 6-2. XP includes the built-in ability to automatically synchronize your clock with an Internet time server
Click OK. Your PC will now synchronize with a time server once a week.
Using the Registry
The default amount of time for synchronizing with a time server is once a week. But you can change that schedule to any you want, using the Registry. Open the Registry Editor, and go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\ Services\W32Time\ TimeProviders\ NtpClient\ SpecialPollInterval. OpenSpecialPollIntervalby double-clicking it, then select Decimal. For the value data, give it the interval, in seconds, that you want your time to be automatically updated. The default is 604,800, which is the number of seconds in a week. There are 86,400 seconds in a day, so if you want your time to synchronized daily, enter that number. Click OK and then exit the Registry.
Using downloadable software
There are many pieces of software available that make it easier to automatically synchronize the time, or give you extra options for time synchronization. A very good free one is SymmTime, which runs as a separate applet. In addition to automatically synchronizing your PC time with Internet time servers, it lets you create separate clocks that each display the time in different parts of the world. It’s particularly useful if you do business across time zones or countries. You can download and use it for free from http://www.ntp-systems.com/symmtime.asp.
Discussion
If you don’t have an always-on connection such as over a LAN or via a cable modem or DSL modem, and your PC isn’t connected at the time it is scheduled to do a synchronization, you may have to synchronize your clock manually, by clicking the Update Now button on the Internet tab of the Date and Time Properties dialog box.
Sometimes, synchronization fails. If so, there are several ways to troubleshoot the problem. First, check to make sure that your Internet connection is working and you’re connected. If you are, the problem may be with the time server—it might not be available. Choose another one from the list. You can also add new time servers to the list by typing their addresses in the Server box on the Internet tab of the Date and Time Properties dialog box. For lists of servers, go to http://www.boulder.nist.gov/timefreq/service/time-servers.html and http://tycho.usno.navy.mil/ntp.html.
Some personal and network firewalls block time synchronization. Check the firewall’s documentation for how to allow synchronization. The Windows Firewall allows time synchronization, so if you’re using that, you should not have a problem. Windows Time uses UDP port 123 to do its synchronization, so if your firewall is blocking it, open that port, and synchronization should work.
Finally, on the Date & Time tab of the Date and Time Properties dialog box, make sure that your computer is using the proper date. If your date is incorrect, your PC will not synchronize with Internet time servers.
See Also
MS KB 262680, “A List of the Simple Network Time Protocol Time Servers That Are Available on the Internet”
You want to change the name of your computer, or a computer on a domain on which you have administrative privileges.
Solution
Using a graphical user interface
Right-click My Computer, choose Properties, and click the Computer Name tab.
Click the Change button.
In the Computer Name Changes dialog box, shown in Figure 6-3, type in your new computer name in the Computer Name box. Click OK and then click OK again.
Figure 6-3. The Computer Name Changes dialog box
You can only use this technique on your own computer, not on another computer in a domain to which you’re attached.
Using a command-line interface
If you want to rename a computer that is a member of an Active Directory domain, you can use thenetdom tool. You’ll be able to rename not just the computer you’re attached to, but others as well, as long as you have administrative permission to do so on the PC. You can do this only on Windows XP Professional, not on Home Edition.
To change a computer’s name, do the following:
Install the Windows XP Support Tools from the Support\Tools folder on the Windows XP Professional CD.
At the command line, use thenetdomcommand line tool to rename a computer, using this syntax:
Machine The current name of the computer that you want to rename.
New_computername The new name that you want to give to the computer.
Domainname\administrator_id The NetBIOS domain name and the administrator identification (ID) of the user account that has administrative permissions to the computer that you want to rename.
Local_admin A user who has local administrative permissions. This can be the same account that you specified for /userd.
The asterisk symbol (*) Used for the /passwordd: and /passwordo: parameters. It specifies that the password should be typed with hidden characters when the command is submitted, for security purposes.
Seconds before automatic reboot, in seconds The amount of time, in seconds, before the computer restarts after it is renamed. If you don’t specify this parameter, the computer will have to be restarted manually.
/userd The user account used to make the connection with the domain specified by the /Domain argument.
/usero The user account for making the connection with the trusting domain.
Discussion
Using a graphical user interface
When using the Computer Name tab, make sure you do not confuse the computer description with the computer name. The computer name is what will show up on a network and will be what your computer is called. The description allows you to provide more details about the computer, for example, “computer in the downstairs living room.”
Using a command-line interface
When you use netdomto rename a computer, you may see the following, lengthy message: “This operation will rename the computer “Mycomputer” to “Yourcomputer.” Certain services, such as certification authority, rely on a fixed computer name. If any services of this type are running on “Mycomputer”, a computer name change would have an adverse impact.” You’ll then be prompted to proceed. If you don’t want this warning to appear, and don’t want to be prompted to proceed, use the/forceswitch when you enter thenetdom command in addition to the other parameters you use.
See Also
MS KB 298593, “How To Use the Netdom.exe Utility to Rename a Computer in Windows XP”
You want to create a multiboot menu that will allow you choose from several different customized versions of Windows—for example, one without a boot screen, one that will automatically create a log about the boot process, and so on.
Solution
Using a graphical user interface
The boot.ini file, a plain text file found in your root C:\ folder, determines how XP starts up and controls a variety of startup options, including whether to use the XP splash screen when XP starts, whether to create a log file about the boot process, and so on.
You might not be able to see boot.ini, because it’s a system file, and if you can see it, you might not be able to edit it, because it’s a read-only file. To make it visible, launch Windows Explorer, and choose View -> Tools -> Folder Options -> View and select the radio button “Show Hidden Files and Folders.” To make it a file you can edit, right-click on it in Windows Explorer, choose Properties, uncheck the Read-Only box, and click on OK.
If you have only one operating system on your PC (XP), boot.ini will look something like this:
[boot loader] timeout=30 default=multi(0)disk(0)rdisk(0)partition(2)\WINDOWS [operating systems] multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Microsoft Windows XP Home Edition" /fastdetect
In this instance, your PC will boot straight into XP; no menu will be displayed to give you any other startup choices.
If you have more than one operating system on your PC, in the following instance XP Home Edition and Windows 2000 Professional, Windows boot.ini would look like this:
[boot loader] timeout=30 default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS [operating systems] multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Home Edition" /fastdetect multi(0)disk(0)rdisk(0)partition(2)\WINNT="Windows 2000 Professional" /fastdetect
In this instance, when you boot your PC, a menu would be displayed, allowing you to choose between booting into XP Home Edition or Windows 2000 Professional.
Even if you have only one version of XP installed, though, you can create a multiboot menu that will let you choose to load XP with different parameters by editing the boot.ini file. For example, for menu choices, you might have your normal operating system; the operating system loading in a mode that lets you trace any startup problems; and the operating system loading in safe mode. To do it, create separate entries for each new operating system choice. For example, for the version of the operating system that traces potential startup problems, you could create this entry:
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Trace Problems XP Home Edition" /fastdetect /bootlog /sos
This entry creates a startup log and displays information about the drivers and other operating system information as it loads.
For the version of the operating system that loads in Safe Mode but that still allows networking, you could create this entry:
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Safe Start XP Home Edition" /fastdetect /safeboot:network
So the boot.ini file would look like this, assuming that you want the menu to display for 30 seconds, and you want normal XP startup to be the default:
[boot loader] timeout=30 default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS [operating systems] multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Home Edition" /fastdetect multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Trace Problems XP Home Edition" /fastdetect /bootlog /sos multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Safe Start XP Home Edition" /fastdetect /safeboot:network
To edit the file, open it with a text editor such as Notepad. Following is a typical boot.ini file for a PC that has two operating systems installed on it—Windows XP Home Edition and Windows Me:
[boot loader] timeout=30 default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS [operating systems] multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Home Edition" /fastdetect multi(0)disk(0)rdisk(0)partition(2)\WINNT="Windows 2000 Professional" /fastdetect
As you can see, there are two sections in the file:[boot loader]and[operating systems]. To customize your menu and startup options, edit the entries in each section. Before editing boot.ini, make a copy of it and save it under a different name (such as boot.ini.old), so that you can revert to it if you cause problems when you edit the file.
Following are details about how to edit the entries in each section:
[boot loader]
This section controls how the boot process works; it specifies the default operating system, and how long a user has to make a selection from a boot menu if a boot menu has been enabled. Thetimeoutvalue specifies, in seconds, how long to display the menu and wait for a selection before loading the default operating system; if you want a delay of 15 seconds, for example, enter15for the value. Use a value of0if you want the default operating system to immediately boot. If you want the menu to be displayed indefinitely and stay onscreen until a selection is made, use a value of –1. Thedefaultvalue specifies which entry in the[operating system]section is the default operating system. (It is used even if there is only one operating system in the[operating system]section.) To change the default operating system, edit the setting, in our example, todefault=multi(0)disk(0)rdisk(0)partition(2)\WINNT.
So in our example, if you were going to change the menu settings so that the screen appeared for 10 seconds before loading the default operating system, and the default operating system is Windows 2000 Professional, the section would read:
This section specifies which operating systems are present on the computer, and detailed options for each one. XP uses the Advanced RISC Computing (ARC) path to specify the location of the boot partition. In our example, the ARC path is:
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS
The first parameter, which identifies the disk controller, should be0. The second parameter, the disk parameter, should also be0. Therdiskparameter specifies the disk number on the controller that has the boot partition. The numbers start at 0. So if you have three hard disks installed, and the second hard disk has the boot partition, the setting would berdisk(1). Thepartitionparameter identifies the partition number of the boot partition. Partitions start with the number 1. The final section, which in our example is\WINDOWS, specifies the path to the folder where the operating system is installed.
To the right of the ARC path, in the example, is="Microsoft Windows XP HomeEdition” /fastdetect. The words within quotes are what will appear on the boot menu next to the entry. You can change this to whatever you wish to customize the text on the menu; if you’d like, you can call it “My Favorite Operating System” or anything else you want. The/fastdetect switch disables the detection of serial and parallel devices, and so allows for faster booting. (The detection of these devices isn’t normally required in XP, because the functions are performed by Plug and Play drivers, and so as a general rule, it’s a good idea to use the/fastdetectswitch. The/fastdetectswitch is only one of many that can be used in the boot.ini file to customize how the operating system loads. Table 6-1 lists others you can use as well.
Table 6-1. Switches for boot.ini
Switch
What it does
/BASEVIDEO
Starts XP using the standard VGA driver. It’s of most use if you can’t boot normally because of a video driver problem.
/BOOTLOG
Logs information about the boot process to the file ntbtlogl.txt in the C:\Windows folder.
/CRASHDEBUG
Loads the debugger at boot, but the debugger remains inactive unless a crash occurs.
/DEBUG
Loads the debugger at boot and runs it.
/FASTDETECT
Disables the detection of serial and parallel devices.
MAXMEM:n
Specifies the maximum amount of RAM that XP can use.
/NOGUIBOOT
Does not allow the XP splash screen to load during boot.
Table 6-1. Switches for boot.ini (continued)
Switch
What it does
/NODEBUG
Stops the debugger from loading.
/SAFEBOOT:
Forces XP to boot into the safe mode specified by the switch parameter, which can be minimal, network,or minimal(alternateshell). In minimal safe mode, only the minimum set of drivers are loaded necessary to start XP. In network-safe mode, the minimum set of drivers plus networking drivers are loaded. In minimal(alternate shell)the minimum set of drivers are loaded and XP boots into the command prompt.
switch
Displays the name of each driver as it loads and gives descriptions of what is occurring during the boot process. It also offers other information, including the XP build number, the service pack number, the number of processors on the system, and the amount of installed memory.
/SOS
When you’ve finished editing the boot.ini file, save it. The next time you start your computer, its settings will go into effect.
So, in our example, if we wanted the menu to appear for 45 seconds, the default operating system to be Windows 2000, and the XP splash screen to be turned off when we choose to load XP, the boot.ini file would look like this:
[boot loader] timeout=45 default=multi(0)disk(0)rdisk(0)partition(2)\WINNT [operating systems] multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Home Edition" / fastdetect /noguiboot multi(0)disk(0)rdisk(0)partition(2)\WINNT="Windows 2000 Professional" /fastdetect
Discussion
If you’ve installed another operating system in addition to XP on your system, your PC automatically starts up with a multiboot menu, which allows you to choose which operating system you want to run. The menu stays live for 30 seconds, and a screen countdown tells you how long you have to make a choice from the menu. After the 30 seconds elapse, it boots into your default operating system, which is generally the last operating system that you installed. To change that menu and your startup options, edit boot.ini.
See Also
Advanced Startup Manager will let you create different profiles for starting XP. It’s shareware; the registration fee is $19.95. Download it from http://www.rayslab.com/ startup_manager/startup_manager.html. Also see MS KB 314081, “The purpose of the Boot.ini file in Windows XP.”
Please check back next week for the continuation of this article.