One of the simplest ways to speed up your PC is by defragmenting your hard disk. Here's how to get the most out of XP's built-in defragmenter and a third-party program that should speed up your hard disk even more .
Perhaps the simplest way to speed up your PC is to use a disk defragmenter, which will help you open applications and files more quickly. As you use applications and files, they get spread out in fragments across your hard disk. The next time you go to use them, they take longer to open because your hard disk has to find each of those disparate fragments so they can be assembled when you open the file. A disk defragmenter stores files and applications contiguous to one another so that they can be fetched much more quickly than if they were spread out across your whole disk.
XP includes a built-in defragmentation program (sometimes called a defragger ), which you can run by choosing Control Panel Performance and Maintenance "Rearrange items on your hard disk to make programs run faster." But there are ways you can use it more effectively, and there are third-party programs that do a more effective job of defragmentation as well.
8.3.1 Defragment Boot Files
One of the biggest improvements of XP's defragger over previous Windows versions is that it can perform a boot defragment, placing all boot files contiguous to one another so that you boot faster. The boot defragment option is usually enabled by default, but there's a possibility that it could be disabled, or enabled improperly. You can make sure it's enabled, using a Registry hack. Run the Registry Editor [Hack #68] and go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Dfrg\BootOptimizeFunction . Find the Enable string. If the String value is set to N , change it to Y . If it is Y , leave it as it is, since that means boot defragmentation is enabled. Exit the Registry and reboot. When you next defragment your disk, the boot files will be defragmented.
8.3.2 Run Disk Defragmenter from the Command Line
If you prefer the command line to the graphical interface, you can avoid maneuvering through menus and dialog screens to defragment your hard drive. (Using the command line also gives you greater control over the defragmentation process, as you'll see in this hack.) To defragment a hard drive, type defrag C : at a command prompt, where C is the hard drive you want to defragment. When you use the command line, you won't see a visual display of the defragmentation process, and you won't be able to pause it or cancel it.
defrag also does work invisibly in the background to make sure that your programs load more quickly. It's set up so that every three days, when your computer is otherwise idle, it moves program code to the outside of the disk to make programs load more quickly. You can force it to do that manually, without having to do a full defragment, by using the - b switch, like this:
defrag C: -b
It takes only a few minutes for defrag to do this, in contrast with a full defragmentation, which can easily take more than 20 minutes, depending on how defragmented your system is and the speed of your processor.
There are several other command-line switches you can use with the defrag command:
8.3.3 What to Do if the Disk Defragmenter Won't Defragment Your Drive
There will be times when the Disk Defragmenter won't defragment your drive, or will defragment it only partially. It won't defragment your drive if you don't have at least 15% of the drive's space free. To solve the problem, as explained previously, type defrag C : /F at the command line, where C is your hard drive.
There are also certain files and areas that the Disk Defragmenter won't defragment: the Recycle Bin, the Windows page file , Bootsect.dos , Safeboot.fs , Saveboot.rsv , Hiberfil.sys , and Memory.dmp . There's not much you can do about it, though it's a good idea to empty the Recycle Bin before defragmenting.
Often, the Disk Defragmenter won't defragment every file on the first pass. Your best bet here is to use brute force: run it again until it defragments the files it missed the first time around. Also, keep in mind that the Disk Defragmenter won't defragment any files that are currently in use, so make sure to close all programs; if there are files that won't defragment, it might be because they're being used by an open program. Sometimes, programs may seem to be shut down, but in fact may be running in a kind of phantom mode. For example, Outlook sometimes stays running even after you've shut it down. To make sure your programs are completely shut down before running the Disk Defragmenter, run the Task Manager by pressing Ctrl-Alt-Delete or right-clicking on the Taskbar and choosing Task Manager. Check both the Applications and Processes tabs to see if any programs, like Word for Windows ( Winword.exe ) or Outlook ( Outlook.exe ), are still running. These two programs sometimes continue running even after you've shut them down.
8.3.4 Get a Better Disk Defragmenter
For most purposes, XP's Disk Defragmenter works fine. But if you're a system administrator who needs to defragment multiple machines or defragment servers, you'll be better off with a better defragmenter. Even single users of XP might want a better disk defragmenter for purposes such as easy scheduling of defragmenting and the ability to defragment files that XP's defragmenter can't handle. Two of the best XP defragmenters are available as try-before-you-buy software:
Figure 8-5. PerfectDisk2000 options