You are here: FAQs > Disk defragmenter questions and answers

Wizcrafts Computer Services

Specializing in Computer Networking, Security and Troubleshooting

Answers to Disk Defragmenter Frequently Asked Questions

Where the term Windows 9x is used here it refers to Windows 95, 98, or 98 Second Edition (SE). Windows ME refers to Millenium Edition.

What is the Windows Disk Defragmenter and what is it's function?

The Disk Defragmenter is a software utility that has been included in almost every Microsoft operating system, from MS-DOS 6.0 through Windows XP (with the exception of Windows NT). It's purpose is to optimize access time and restore continuity to a fragmented file system. It does this by locating separated fragments of files and programs and restoring them to continuous sequences. The purpose of Disk optimization is to optimize the time it takes to read and write files to/from the disk by minimizing head travel time and maximizing the transfer rate.

Computer operating systems divvy up space on their hard drives into tiny segments of bytes called "Clusters," with the actual byte-size based on varying factors. Typically a cluster on a Windows computer will range from 4096 to 8192 bytes in size.

In the normal course of working with files or installing programs there is always the possibility that altho your hard disk has lots of free space on it, the space needed by a certain file or program may not exist in one continuous sequence of "clusters". When this occurs the program's parts must be saved to different areas on the hard disk, spanning many "clusters".

A cluster represents the smallest continuous amount of disk space on which any file can be stored, in part or in whole. The default cluster size in Windows 98/ME/2000/XP is only 4096 bytes, depending on the Operating System and hard drive capacity (in Windows 9x). Often, a file is much too large to fit on only one cluster and must occupy many clusters when saved to disk. Each cluster has a code to identify the filename of the data it contains, so that when the file is needed it is assembled by polling the hard disk for all clusters containing the assigned code for that file.

In the course of working with files, ie: saving, deleting, modifying them, these clusters become (more) separated from their original grouping. This is what is called "fragmentation". If your disk becomes significantly fragmented it will take longer and longer to find and assemble files and programs. This slowdown usually occurs when your disk has 4% or more fragmentation. In very large hard disks the fragmentation may only need to be 2% to affect performance. Running Defragmenter optimizes the distribution of free space and calls these multi-part file clusters back together, in a continuous sequence. Frequently used files and programs get moved toward the front of the drive where they are accessed faster.

Note that the Windows Disk Defragmenter requires at least 15% free space to move files around as it reassembles them into contiguous sections. Even with the minimum recommended 15% free space the defragmenter may not be able to reassemble huge files that have become fragmented, and you may have to start deleting files or programs to free up some more space. You can start by running the Windows Cleanup Tool to remove temporary files and empty your Recycle Bin. It is found at: Start > Programs > Accessories > System Tools > Disk Cleanup.

Where are the shortcuts to start the defragmenter tool?

#1: Click on the Start button, then Programs, then Accessories, then System Tools. There is a shortcut to your Disk Defragmenter there.

#2: For Windows 2000/XP, double-click on the icon "My Computer". Right-click on the drive icon representing the hard disk or partition you want to check. Select Properties from the flyout menu. Click the Tools tab at the top. From there you can run Defragmenter, Error-checking (Chkdsk), and File/Folder Backups.

What is the command line shortcut to automatically run the defragmenter, then exit?

The command I used for Windows 9x is: DEFRAG /ALL /F /P /NOPROMPT which will defragment all hard drives and partitions, then exit.

It can be executed from the RUN command (off the Start button), from a DOS window within Windows 9x, or from the Task Scheduler.

Note that Defragmenter for Windows 9x must only be run from within Windows itself, not from an MSDOS bootup. This is done to protect long filenames that DOS doesn't comprehend.

Note for Windows 2000 or XP users: The only command-line method of defragmenting in Windows 2000 or XP is to go to Start > Run, and type in this command: %SystemRoot%\system32\dfrg.msc then press the Enter key. Otherwise, it must be run by either navigating to the Defragmenter shortcut in Start > Programs > Accessories > System Tools, or by right-clicking on a drive letter icon in My Computer, or by right-clicking on My Computer, selecting "Manage" (Computer Management opens) > Storage > Disk Defragmenter > Select the drive you want to Defragment, then choose either the Analyze or Defragment buttons, under "Defragmentation Display."

Also different from Windows 9x, the Windows 2000 and XP Defragmenter can only Defragment one volume at a time. There is no command to Defrag all partitions as there was in Windows 9x.

What can I do to get defragmenter to stop restarting constantly?

This is now mostly a thing of the past, but was a big problem for Windows 9x users. You would start your defragmenter program and watch it bounce back to 0% over and over again. This occurs when the defragmenter tries to move fragments of files that are open, or in use.

The recommended solution is to close all tasks that are running in the background, and all open applications and windows, and to disable your screen saver temporarily. To close the background applications and processes (Windows 9x), press the "three finger salute" - Control + Alt + Delete, which opens the "Close Program" dialog box in Windows 9x, or the Windows (Security) Task Manager in Windows 2000 and XP. For Windows 9x users a single window will popup with a list of running processes and applications. Highlight a listed program then click on "End Task". Repeat this until only Explorer and Defrag are left running. Windows 2000 and XP have all kinds of necessary system services running in the background, but if you just click on the Task Manager button, then on the Applications Tab, you will be able to end any programs that you have knowingly opened, which might be interfering with your defragmenting task.

If you get a popup message that a program you tried to close is not responding, click the End Task button on the popup box. This usually terminates the dead program, unless it has crashed hopelessly.

Sometimes the only way to get a complete Defragmentation in Windows 9x is to do a "warm reboot" by holding down the Shift key as Windows 9x reloads, then closing all running tasks except Explorer (using the Close Program box).

Alternately, if you can't get them to finish, try rebooting into Safe Mode, which is a basic Windows GUI (Graphical User Interface) without any auxillary drivers or normal startup programs loaded. Safe Mode usually gets the job done when all else fails.

MS Office Fast Find, Office Fast Start, the Windows Indexing Service, and anti virus programs are especially well known for interfering with Defragmenting operations, especially in Windows 9x.


In conclusion, a fragmented hard drive will slow down your computer's response time, while a defragmented drive will perform much faster and be quieter.

List of Microsoft articles about the Disk Defragmenter tool.

Back to our main FAQs page

(back to top)