5.5. Performing Diagnostics and Tuning Performance

At the command prompt, a few commands can be used to optimize and diagnose your computer. defrag.exe can be used to optimize your hard drive, and chkdsk.exe can be used to check your disk for errors. When creating an MS-DOS boot disk, you would have used mem.exe to view memory used when trying to optimize your memory usage.

The MS-DOS or command prompt versions of the defrag.exe and chkdsk.exe utilities have now been replaced by Windows versions.

5.5.1. defrag.exe

The purpose of the defrag.exe utility is to fix speed and performance problems with hard drives. As files are written to and then deleted from a disk, they leave holes or blank areas scattered around your drive. When you write files to a disk, they always write to the largest open spaces that are available to them. There will be times when the largest area is not large enough for the entire file, and the file will have to be split into pieces. These fragmented files are slower to access because the disk head has to keep moving to a new location on the drive. To defragment the files on your hard drive, use Computer Management in Windows, or defrag in Windows XP or Windows Vista. To provide command line access to all Windows-based utilities, Microsoft provides command line access to the graphical defragmenter utility.

In either case, you are using the defragmentation utility from Executive Software, and you have the option to analyze only or to force defragmentation when ...

Get CompTIA A+® Certification All-In-One For Dummies®, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.