Read an Excerpt
Maintaining Your System in�10 Easy Steps
- Step 1Check Your Hard Disk for Errors
- Running the Check Disk GUI
- Running Check Disk from the Command Line
- Step 2Check Free Disk Space
- Step 3Delete Unnecessary Files
- Step 4Defragment Your Hard Disk
- Running the Disk Defragmenter Tool
- Defragmenting from the Command Line
- Step 5Set System Restore Points
- Step 6Back Up Your Files
- Step 7Run the Automated System Recovery
- Step 8Check For Updates and Security Patches
- Checking the Windows Update Web Site
- Checking for Security Vulnerabilities
- Step 9Verify Digitally Signed Files
- Step 10Review Event Viewer Logs
- Setting Up a Maintenance Schedule
12 Maintaining Your System in 10 Easy Steps
In this chapter, you�ll learn how to:
- Maintain your hard disk by checking for errors, deleting unnecessary files, and defragmenting files.
- Set up your system for easier recovery by creating restore points and by backing up your files.
- Keep your system up-to-date by checking for updates, patches, and security vulnerabilities.
- Set up a maintenance schedule to keep your system running in peak form without burdening your schedule.
Computer problems, like the proverbial death and taxes, seem to be one of those constants in life. Whether it�s a hard disk biting the dust, a power failure that trashes your files, or a virus that invades your system, the issue isn�t whether something will go wrong, but rather when will it happen. Instead of waiting to deal with these difficulties after they occur (what we call pound-of-cure mode), you need to become proactive and perform maintenance on your system in advance (ounce-of-prevention mode). This will not only reduce the chances that something will go wrong, but it will also set up your system to more easily recover from any problems that do occur. This chapter shows you how various Microsoft Windows XP utilities and techniques can help you do just that. In particular, we give you a step-by-step plan for maintaining your system and checking for the first signs of problems.
Our hard disks store our programs and, most important, our precious data, so they have a special place in the computing firmament. They ought to be pampered and coddled to ensure a long and trouble-free existence, but, unfortunately, that�s rarely the case. Just consider everything that a modern hard disk has to put up with:
- Wear and tear If your computer is running right now, its hard disk is spinning away at between 5,400 and 10,000 revolutions per minute. That�s right even though you�re not doing anything, the hard disk is hard at work. Because of this constant activity, most hard disks simply wear out after a few years.
- Bumps and thumps Your hard disk includes "read/write heads" that are used to read data from, and write data to, the disk. These heads float on a cushion of air just above the spinning hard disk platters. A bump or jolt of sufficient intensity can send them crashing onto the surface of the disk, which could easily result in trashed data. If the heads happen to hit a particularly sensitive area, the entire hard disk could crash.
- Power surges The current that is supplied to your PC is, under normal conditions, reasonably constant. The possibility exists, however, for your computer to be assailed by massive power surges (for example, during a lightning storm). These surges can wreak havoc on a carefully arranged hard disk.
So what can you do about these flies in the ointment? Windows XP comes with a program called Check Disk that can check your hard disk for problems and repair them automatically. It might not be able to recover a totally trashed hard disk, but it can at least let you know when a hard disk might be heading for trouble.
Check Disk has two versions: a GUI version and a command-line version, both of which we discuss in the next two sections.
Here are the steps to follow to run the GUI version of Check Disk:
- In Windows Explorer, right-click the drive you want to check and then select Properties.
- On the drive�s property sheet, select the Tools tab.
- Click the Check Now button. The Check Disk window appears, as shown in Figure 12-1.
- You have two options:
Figure 12-1 Use Check Disk to scan a hard disk partition for errors. (Image unavailable)
- Automatically Fix File System Errors If you select this check box, Check Disk will automatically repair any file system errors that it finds. If you leave this option cleared, Check Disk just reports any errors it finds.
- Scan For And Attempt Recovery Of Bad Sectors If you select this check box, Check Disk performs a sector-by-sector surface check of the hard disk surface. If Check Disk finds a bad sector, it automatically attempts to recover any information stored in the sector and marks the sector as defective so no information can be stored there in the future.
If you click Yes when Check Disk asks if you want to schedule the scan for the next boot, the program adds the AUTOCHK utility to the following registry setting:
This setting specifies the programs that Windows XP should run at boot time when the Session Manager is loading. AUTOCHK is the automatic version of Check Disk that runs at system startup. When AUTOCHK is scheduled, you see the following the next time you restart the computer:
A disk check has been scheduled.
To skip disk checking, press any key within 10 second(s).
You can bypass the check by pressing a key before the timeout expires. Note that you can change the timeout value by creating a DWORD value named AutoChkTimeOut in the following registry key:
Set this to the number of seconds you want to use for the timeout. Another way to do this is to use the CHKNTFS /T:[time] command, where time is the number of seconds to use for the timeout. (If you exclude time, CHKNTFS returns the current timeout setting.) For example, the following command sets the timeout to 60 seconds:
Here�s the syntax for Check Disk�s command-line version:
CHKDSK [volume [filename]] [/F] [/V] [/R] [/X] [/I] [/C] [/L:[size]]
|volume||The drive letter (followed by a colon) or volume name.|
|filename||On FAT16 and FAT32 disks, the name of the file to check for fragmentation. Include the path if the file isn�t in the current folder.|
|/F||Tells Check Disk to automatically fix errors. This is the same as running the Check Disk GUI with the Automatically Fix File System Errors option selected.|
|/V||Runs Check Disk in verbose mode. On FAT16 and FAT32 drives, Check Disk displays the path and name of every file on the disk; on NTFS drives, it displays cleanup messages, if any.|
|/R||Tells Check Disk to scan the disk surface for bad sectors and recover data from the bad sectors, if possible. This is the same as running the Check Disk GUI with the Scan For And Attempt Recovery Of Bad Sectors option selected.|
|/X||On NTFS non-system disks that have open files, forces the volume to dismount, invalidates the open file handles, and then runs the scan (the /F switch is implied).|
|/I||On NTFS disks, tells Check Disk to check only the file system�s index entries.|
|/C||On NTFS disks, tells Check Disk to skip the checking of cycles within the folder structure. A cycle is a corruption in the file system whereby a subfolder�s parent folder is listed as the subfolder itself. (For example, a folder named C:\Data should have C:\ as its parent; if C:\Data is a cycle, then C:\Datathe same folderis listed as the parent, instead.) This creates a kind of loop in the file system that can cause the cycled folder to "disappear." This is a rare error, so using /C to skip the cycle check can speed up the disk check.|
|/L:size||On NTFS disks, tells Check Disk to set the size of its log file to the specified number of kilobytes. The default size is 65,536, which is plenty big enough for most systems, so you should never need to change the size. Note that if you include this switch without the size parameter, CHKDSK tells you the current size of the log file.|
Hard disks with capacities measured in the tens of gigabytes are commonplace nowadays, so disk space is much less of a problem than it used to be. Still, you need to keep track of how much free space you have on your disk drives, particularly the Windows XP system drive, which usually stores the virtual memory page file.
One way to check disk free space is to view My Computer using the Details view, which includes columns for Total Size and Free Space, as shown in Figure 12-2. Alternatively, right-click the drive in Windows Explorer and then select Properties. The disk�s total capacity as well as its current used and free space appear on the General tab of the disk�s property sheet.
Figure 12-2 Display My Computer in Details view to see the total size and free space on your system�s disks. (Image unavailable)
Here�s a VBS script that displays the status and free space for each drive on your system:
Dim objFSO, colDiskDrives, objDiskDrive, strMessage
� Create the File System Object
Set objFSO = CreateObject("Scripting.FileSystemObject")
� Get the collection of disk drives
Set colDiskDrives = objFSO.Drives
� Run through the collection
strMessage = "Disk Drive Status Report" & vbCrLf & vbCrLf
For Each objDiskDrive in colDiskDrives
� Add the drive letter to the message
strMessage = strMessage & "Drive: " _ & objDiskDrive.DriveLetter & vbCrLf
� Check the drive status
If objDiskDrive.IsReady = True Then
� If it�s ready, add the status and the free space to the message
strMessage = strMessage & "Status: Ready" & vbCrLf
strMessage = strMessage & "Free space: " & objDiskDrive.FreeSpace
strMessage = strMessage & vbCrLf & vbCrLf
� Otherwise, just add the status to the message
strMessage = strMessage & "Status: Not Ready" & vbCrLf & vbCrLf
� Display the message
This script creates a FileSystemObject and then uses its Drives property to return the system�s collection of disk drives. Then a For Each...Next loop runs through the collection, gathering the drive letter, the status, and, if the disk is ready, the free space. It then displays the drive data, as shown in Figure 12-3.
Figure 12-3 The script displays the status and free space for each drive on your system. (Image unavailable)
If you find that a hard-disk partition is getting low on free space, you should delete any unneeded files and programs. Windows XP comes with a Disk Cleanup utility that enables you to remove certain types of files quickly and easily. Before discussing this utility, let�s look at a few methods you can use to perform a spring cleaning on your hard disk by hand:
- Uninstall programs you don�t use. If you have an Internet connection, you know it�s easier than ever to download new software for a trial run. Unfortunately, that also means it�s easier than ever to clutter your hard disk with unused programs. Use Control Panel�s Add Or Remove Programs icon to uninstall these and other rejected applications.
- Delete downloaded program archives. Speaking of program downloads, your hard disk is probably also littered with ZIP files or other downloaded archives. For those programs you use, you should consider moving the archive files to a removable medium for storage. For programs you don�t use, consider deleting the archive files.
- Remove Windows XP components that you don�t use. If you don�t use some Windows XP components (such as MSN Explorer, Paint, and some or all of the Windows XP games), in Control Panel, select Add Or Remove Programs, Add/Remove Windows Components to remove those components from your system.
- Delete application backup files. Applications often create backup copies of existing files and name the backups using either the .bak or .old extension. Use Windows Explorer�s Search utility to locate these files and delete them.
Once you�ve completed these tasks, you next should run the Disk Cleanup utility, which can automatically remove several other types of files. Here�s how it works:
- Select Start, All Programs, Accessories, System Tools, Disk Cleanup. The Select Drive dialog box appears.
- Choose the disk drive you want to work with and then click OK. Disk Cleanup scans the drive to see which files can be deleted and then displays a window similar to the one shown in Figure 12-4.
- In the Files To Delete list, select the check box beside each category of file you want to remove. If you�re not sure what an item represents, select it and read the text in the Description box. Note, too, that for most of these items you can click View Files to see what you�ll be deleting.
- Click OK. Disk Cleanup asks if you�re sure you want to delete the files.
- Click Yes. Disk Cleanup deletes the selected files.
Figure 12-4 Disk Cleanup can automatically and safely remove certain types of files from a disk drive. (Image unavailable)
Windows XP offers two methods for bypassing the Select Drive dialog box. One is to right-click the disk drive in Windows Explorer and then click the Disk Cleanup button on the General tab of the drive�s property sheet. The other is to select Start, Run, and enter cleanmgr /ddrive, where drive is the letter of the drive you want to work with (for example, cleanmgr /dc).
It�s possible to save your Disk Cleanup settings and run them again at any time. This is handy if you want to, say, delete all your downloaded program files and temporary Internet files at shutdown. Launch the command prompt and then enter the following command:
Note that the number 1 in the command is arbitrary: you can enter any number between 0 and 65535. This launches Disk Cleanup with an expanded set of file types to delete. Make your choices and click OK. What this does is save your settings to the registry; it doesn�t delete the files. To delete the files, open the command prompt and run the following command:
Note that you can also create a shortcut for this command, add it to a batch file, or schedule it with the Task Scheduler.
Windows XP comes with a utility called Disk Defragmenter that�s an essential tool for tuning your hard disk. Disk Defragmenter�s job is to rid your hard disk of file fragmentation, which occurs when a file is stored in multiple places on a partition. Defragmenting files stores them contiguously, which greatly improves hard-disk performance because Windows XP can load each file from a single location on the disk.
Before using Disk Defragmenter, you should perform a couple of housekeeping chores:
- Delete any files from your hard disk that you don�t need, as described in the previous section. Defragmenting junk files only slows down the whole process.
- Check for file-system errors by running Check Disk as described in Step 1 of this chapter.
Follow these steps to use Disk Defragmenter:
- Select Start, All Programs, Accessories, System Tools, Disk Defragmenter. Alternatively, in Windows Explorer, right-click the drive you want to defragment, select Properties, and then select the Tools tab in the dialog box that appears. Click the Defragment Now button. Either way, the Disk Defragmenter window appears, as shown in Figure 12-5.
- Select the drive you want to defragment.
- Click Analyze. Disk Defragmenter analyzes the fragmentation of the selected drive and then displays its recommendation (for example, You should defragment this volume).
- Click View Report for fragmentation details in the Analysis Report window. If you don�t want to defragment the drive, click Close; if you want to defragment the drive, click Defragment.
Figure 12-5 Use Disk Defragmenter to eliminate file fragmentation and improve hard disk performance. (Image unavailable)
If you want to schedule a defragment or perform this chore from a batch file, you need to use the DEFRAG command-line utility. Here�s the syntax:
DEFRAG volume [-a] [-f] [-v]
|volume||Specifies the drive letter (followed by a colon) of the disk you want to defragment.|
|-a||Tells DEFRAG to only analyze the disk.|
|-f||Forces DEFRAG to defragment the disk, even if it doesn�t need defragmenting or if the disk has less than 15 percent free space. (DEFRAG normally requires at least that much free space because it needs an area in which to sort the files.)|
|-v||Runs DEFRAG in verbose mode, which displays both the analysis report and the defragmentation report.|
One of the biggest causes of Windows instability in the past was the tendency for some newly installed programs to simply not get along with Windows. It could be an executable file that didn�t mesh with the Windows system or a registry change that brought chaos to other programs or to Windows itself. Similarly, hardware installations often caused problems by adding faulty device drivers to the system or by corrupting the registry.
To help recover from software or hardware installations that bring down the system, Windows XP offers the System Restore feature. Its job is straightforward, yet clever: It takes periodic snapshotscalled restore points or checkpointsof your system, each of which includes the currently installed program files, registry settings, and other crucial system data. The idea is that if a program or device installation causes problems on your system, you use System Restore to revert your system to the most recent restore point before the installation.
System Restore creates restore points automatically under the following conditions:
- Every 24 hours This is called a system checkpoint, and it�s set to occur once a day as long as your computer is running. (If your computer isn�t running, the system checkpoint is created the next time you start your computer, assuming it has been at least 24 hours since the previous system checkpoint was set.)
- Before installing certain applications Some newer applicationsnotably Microsoft Office 2000 and laterare aware of System Restore and will ask it to create a restore point prior to installation.
- Before installing a Windows Update patch System Restore creates a restore point before you install a patch either manually via the Windows Update site, or via the Automatic Updates feature.
- Before installing an unsigned device driver Windows XP warns you about installing unsigned drivers. If you choose to go ahead, the system creates a restore point prior to installing the driver.
- Before restoring backed-up files When you use the Windows XP Backup program to restore one or more backed-up files, System Restore creates a restore point just in case the restoration causes problems with system files.
- Before reverting to a previous configuration using System Restore Sometimes reverting to an earlier configuration doesn�t fix the current problem, or it creates its own set of problems. In these cases, System Restore creates a restore point before reverting so that you can undo the restoration.
The RPGlobalInterval setting governs the system checkpoint interval via the following registry key:
The value is in seconds, and the default is 86400 (24 hours). If you often change your system configuration, you might prefer a shorter interval of, say, 28800 (8 hours). Note, too, that you can also adjust the RPSessionInterval value, which controls the intervals in seconds, that System Restore waits before a system checkpoint is created during each Windows XP session (the default is 0, meaning that the feature is turned off). Finally, the RPLifeInterval value determines the number of days that Windows XP maintains restore points. The default is 7776000 (90 days).
It�s also possible to create a restore point manually using the System Restore user interface. Here are the steps to follow:
- Select Start, All Programs, Accessories, System Tools, System Restore. The System Restore window appears.
- Select the Create A Restore Point option and click Next.
- Use the Restore Point Description text box to enter a description for the new checkpoint, and then click Create. System Restore creates the restore point and displays the Restore Point Created window.
- Click Close.
To change how much disk space System Restore uses to store checkpoints, launch Control Panel�s System icon and select the System Restore tab. Select the drive you want to work with and then click Settings. Use the Disk Space Usage slider to specify the amount of disk space you want to reserve for the exclusive use of System Restore. Note that for any drive, except the drive on which Windows XP is installed, you can toggle System Restore on and off using the Turn Off System Restore On This Drive check box.
The Backup program that comes with Windows XP does a fine job of making all-important backup copies of your important files. (If you�re using Windows XP Home Edition, note that you need to install Backup from the Windows XP Home Edition CD. In the VALUEADD\MSFT\NTBACKUP folder, launch the Ntbackup.msi file.) Here are the steps to follow to define and run a backup job:
- Select Start, All Programs, Accessories, System Tools, Backup. The Backup Or Restore Wizard appears.
- Click the Advanced Mode link to display the Backup Utility window.
- Select the Backup tab.
- Select Tools, Options, make sure the Backup Type tab is displayed, and then use the Default Backup Type list to choose one of the following options (click OK when you�re done):
- Normal Backs up all the files in the backup job. Each file is marked (that is, its archive bit is turned off) to indicate that the file has been backed up.
- Incremental Backs up only those files that have changed since the last normal or incremental backup. This is the fastest type because it includes only the minimum number of files. Again, the files are marked to indicate that they�ve been backed up.
- Differential Backs up only those files that have changed since the last non-differential backup. Files are not marked to indicate they�ve been backed up. So, if you run this type of backup again, the same files get backed up (plus any others that have been added or changed in the meantime).
- Copy Makes copies of the selected files. This type of backup does not mark the files as having been backed up.
- Daily Backs up only those files that were modified on the day you run the backup. Files are not marked as having been backed up.
Notes from the Real World:
It�s a rare computer user these days who doesn�t know that backing up is important. So why do so many of us put off backing up? I think the main reason is that it�s often a difficult or inconvenient process. However, there are a few things you can do to make backing up easier. Here are some ideas that I use to make my backup chores more palatable:
- Forget floppies, if possible. Backing up to floppy disks ranks just above "root canal" on the Top 10 Most Unpleasant Chores list. The reason, of course, is that a standard 3.5-inch floppy disk holds a mere 1.39 MB (not 1.44 MB) of data. If your hard disk contains hundreds of megabytes, you�ll have to back up to hundreds of floppy disks, which hurts just to think about it.
- Try a tape drive. Tape drives are the de facto backup standard, and they come in many different capacities. You can back up hundreds of megabytes or even multiple gigabytes for a relatively low cost.
- Try other backup media. The big downfall for tape drives is their relatively slow access times. Fortunately, there are much faster media available. These include CD-R and CD-RW drives or the even more capacious DVD-R, DVD-RW, DVD+R, and DVD+RW drives; removable media such the Iomega Zip or Jaz drives; a second hard disk (not a second partition on the same hard disk!); and a network folder.
- Consider online backups. If your ISP provides you with disk space for a Web site, use it to back up your most important files. Note, too, that there are also companies that will sell you online disk space for backups.
- Back up data, not programs. Although a full system backup can come in handy, it isn�t strictly necessary. The only irreplaceable files on your system are those you created yourself, so they�re the ones you should spend the most time protecting.
- Keep data together. You save an immense amount of backup time if you store all your data files in one place. It could be the My Documents folder, a separate partition, or a separate hard disk. In each case, you can select all the data files for backup simply by selecting a single folder or drive check box.
- Back up downloaded archives. If space is at a premium, you can leave program files out of your backup job because they can always be reinstalled from their source disks. The exceptions to this are downloaded programs. To avoid having to find and download these files again, make backup copies of the archives.
- Don�t always run the full backup. You can speed up your backup times by running differential or incremental backups.
The worst-case scenario for PC problems is a system crash that renders your hard disk or system files unusable. Your only recourse here is to start from scratch, either with a reformatted hard disk or a new hard disk. This usually means that you have to reinstall Windows XP and then reinstall and reconfigure all your applications. In other words, you�re looking at the better part of a day or, more likely, a few days to recover your system.
However, Windows XP comes with a utility called Automated System Recovery that, with a little advance planning on your part, can help you recover from a crash in just a few steps. What kind of advance planning is required? Just two things:
- You must run the Automated System Recovery Preparation Wizard. This wizard backs up your system files and creates a disk that enables you to restore your system.
- You must run a full backup of all your data and application files.
If you�re not replacing your hard disk and if you have your application files and data files on a separate partition, you don�t have to back up that partition because you won�t be formatting it.
Because your system, application, and data files change regularly, to ensure a smooth recovery, you need to do both of these things regularly. Here are the steps to follow to run the Automated System Recovery Preparation Wizard:
- In the Backup Utility window, select Tools, ASR Wizard. The Automated System Recovery Preparation Wizard appears.
- Click Next. The wizard prompts you for a backup destination for your system files.
- Choose the backup media type and then enter the backup media or file name. Click Next.
- Click Finish. The wizard backs up your system files. When it�s done, it prompts you to insert a floppy disk in drive A.
- Insert a blank, formatted disk and click OK. The wizard copies the files Asr.sif, Asrpnp.sif, and Setup.log to the disk and lets you know when it has finished.
- Click OK.
Don�t back up the system files to the %SystemDrive% partition because this is the partition you�ll be formatting as part of your recovery effort.
To learn how to recover your system using Automated System Recovery, see Chapter 13, "Troubleshooting and Recovering from Problems."
Microsoft is working constantly to improve Windows XP with bug fixes, security patches, new program versions, and device driver updates. All of these new and improved components are made available online, so you should check for updates and patches often.
The main online site for Windows XP updates is the Windows Update Web site, which you load into your Web browser by selecting Start, All Programs, Windows Update. Click Scan For Updates to look for crucial new components that can make Windows XP more reliable and more secure. This process should become a regular part of your routine.
Windows XP also comes with a vastly improved automatic updating feature, which can download and install updates automatically. If you prefer to know what�s happening with your computer, it�s possible to control the automatic updating by following these steps:
- Launch Control Panel�s System icon to display the System Properties dialog box.
- Select the Automatic Updates tab, shown in Figure 12-6.
- If you don�t want Windows XP to use automatic updating, clear the Keep My Computer Up To Date check box.
- If you left the Keep My Computer Up To Date option selected, use the Settings section of the dialog box to determine how Windows XP performs the updating:
Figure 12-6 Use the Automatic Updates tab to configure Windows XP�s automatic updating. (Image unavailable)
- Notify Me Before Downloading Any Updates And Notify Me Again Before Installing Them On My Computer This option gives you the most control because it lets you reject the update either before the download or before the installation.
- Download The Updates Automatically And Notify Me When They Are Ready To Be Installed This option gives Windows XP control over the downloading of the updates.
- Automatically Download The Updates, And Install Them On The Schedule That I Specify This option lets you control when the downloaded updated are installed. For example, you might prefer to choose a time when you won�t be using your computer.
Microsoft regularly finds security vulnerabilities in components such as Microsoft Internet Explorer and Windows Media Player. Fixes for these problems are usually made available via Windows Update. However, to ensure that your computer is safe, you should download and regularly run the Microsoft Baseline Security Analyzer. This tool not only scans your system for missing security patches, but it also looks for things such as weak passwords and other Windows vulnerabilities.
After you install the tool, follow these steps to use it:
- Select Start, All Programs, Microsoft Baseline Security Analyzer. The program�s Welcome screen appears.
- Click Scan A Computer.
- Your computer should be listed in the Computer Name list. If not, choose it from that list. (Alternatively, use the IP Address text boxes to enter your computer�s IP address.)
- Use the Options check boxes to specify the security components you want to check. For most scans you should leave all the options selected.
- Click Start Scan. The program checks your system and displays a report on your system�s security (and usually offers remedies for any vulnerabilities it finds).
In Chapter 9, "Installing and Troubleshooting Devices," you learned that digitally unsigned drivers are often the cause of system instabilities. To ensure you don�t accumulate unsigned drivers on your system (particularly if you share your computer with other users), you should regularly run the Signature Verification Tool. This program scans your entire system (or, optionally, a specific folder) for unsigned drivers. Follow these steps to run this tool:
- Select Start, Run, enter sigverif, and click OK. The File Signature Verification window appears.
- Click Advanced to display the Advanced File Signature Verification Settings dialog box.
- Select the Look For Other Files That Are Not Digitally Signed option.
- In the Look In This Folder text box, enter SystemRoot\System32
\drivers, where SystemRoot is the folder in which Windows XP is installed (such as C:\WINDOWS).
- Click OK.
- Click Start to begin the verification process.
When the verification is complete, the program displays a list of the unsigned driver files. (The results for all the scanned files are copied to the log file Sigverif.txt, which is located in the %SystemRoot% folder. In the Status column, look for files listed as "Not Signed.")
Windows XP constantly monitors your system for unusual or noteworthy occurrences. It might be a service that doesn�t start, the installation of a device, or an application error. These occurrences are called events, and Windows XP tracks them in three different event logs:
- Application This log stores events related to applications, including Windows XP programs and third-party applications.
- Security This log stores events related to system security, including logons, user accounts, and user privileges. Note that this log doesn�t record anything until you turn on Windows XP�s security auditing features. You do this by opening the Group Policy Editor and selecting Computer Configuration, Windows Settings, Local Policies, Audit Policy. You can then enable auditing for any of the several polices listed.
- System This logs stores events generated by Windows XP and components such as system services and device drivers.
The System log lists device driver errors, but remember that Windows XP has other tools that make it easier to see device problems. As we discussed in Chapter 9, "Installing and Troubleshooting Devices," Device Manager displays an icon on devices that have problems, and you can view a device�s property sheet to see a description of the problem. Also, the System Information utility (Msinfo32.exe) reports hardware woes in the System Information, Hardware Resources, Conflicts/Sharing branch and the System Information, Components, Problem Devices branch.
You should scroll through the Application and System event logs regularly to look for existing problems or for warnings that could portend future problems. (The Security log isn�t as important for day-to-day maintenance. You need to use it only if you suspect a security issue with your machine; for example, if you want to keep track of who logs on to the computer.) To examine these logs, you use the Event Viewer snap-in, available either via selecting Start, Run and entering Eventvwr.msc or by launching Control Panel�s Administrative Tools icon and selecting Event Viewer. Figure 12-7 shows a typical Event Viewer window. Use the tree in the left pane to select the log you want to view: Application, Security, or System.
Figure 12-7 Use the Event Viewer to monitor events generated by applications and Windows XP. (Image unavailable)
When you select a log, the right pane displays the available events, including the event�s date, time, and source, its type (Information, Warning, or Error), and other data. To see a description of an event, double-click it or select it and press Enter.
Rather than monitoring the event logs by hand, Windows XP comes with a couple of tools that can help automate the process. The Eventquery.vbs script enables you to query the log files for specific event types, IDs, sources, and more. Search Windows XP�s Help And Support Center for "eventquery" to get the script�s command-line syntax. Also, you can set up an event trigger that will perform some action when a particular event occurs. You do this using the Eventtriggers.exe utility. Search the Help And Support Center for "eventtriggers" to get the full syntax for this tool.
Maintenance is effective only if it�s done regularly, but there�s a fine line to be navigated here. If maintenance is performed too often, it can become a burden and interfere with more interesting tasks; if it�s performed too seldom, it becomes ineffective. So how often should you perform the maintenance steps listed in this chapter? Here are our schedule guidelines:
- Check your hard disk for errors. Run a basic scan about once a week. Run the more thorough disk surface scan once a month. (The surface scan takes a long time, so run it when you won�t be using your computer for a while.)
- Check free disk space. Do this once about once a month. If you have a drive in which the free space is getting low, check it about once a week.
- Delete unnecessary files. If free disk space isn�t a problem, run this chore about once every two or three months.
- Defragment your hard disk. How often you defragment your hard disk depends on how often you use your computer. If you use it every day, you should run Disk Defragmenter about once a week. If your computer doesn�t get heavy use, you probably need to run Disk Defragmenter only once a month or so.
- Set restore points. Windows XP already sets regular system checkpoints, so you need only create your own restore points when you�re installing a program or device or making some other major change to your system.
- Back up your files. Perform a full backup of all your documents, as well as a backup of the system state, about once a month. Do a differential backup of modified files once a week. Do an incremental backup of modified files every day.
- Check Windows Update. If you�ve turned off automatic updating, you should check in with the Windows Update Web site about once a month.
- Check for security vulnerabilities. Run the Microsoft Baseline Security Analyzer once a month. You should also pay a monthly visit to Microsoft�s Security And Privacy site to keep up to date on the latest security news, get security and virus alerts, and more.
- Verify digitally signed files. If other people use your computer regularly, you should run the Signature Verification Tool every couple of months.
- Review event viewer logs. If your system appears to be working fine, you need to check the Application and System log files just weekly or every couple of weeks. If the system has a problem, check the logs daily to look for Warning or Error events.
Remember as well that Windows XP offers a number of options for running most of these maintenance steps automatically:
- If you want to run a task every day, you can set it up to launch automatically at startup, as we describe in Chapter 4, "Starting Up and Shutting Down."
- Use the Task Scheduler (Start, All Programs, Accessories, System Tools, Scheduled Tasks) to set up a program on a regular schedule. Note that some programs, particularly Disk Defragmenter, can�t be scheduled in their GUI form. You need to use the command-line version instead.
- The Backup program enables you to schedule backup jobs. In the Backup Utility window, select the Schedule Jobs tab and click Add Job.
- Use the automatic updating feature instead of checking for Windows updates by hand.