What is defrag.exe?

A. One of the problems with the welcome addition of the disk defragmenter in Windows 2000 is that it has no command-prompt equivalent. As a result, you can't easily schedule the defragmenter to run. To address this problem, Microsoft included defrag.exe in Windows XP for command-level disk defragmentation.

An example analysis execution shows

   C:\>defrag d: -a
   Windows Disk Defragmenter
   Copyright (c) 2001 Microsoft Corp. and Executive Software
   International, Inc.

   Analysis Report
   6.91 GB Total, 6.73 GB (97%) Free, 2% Fragmented (5% file

The command format is

   defrag <volume> \[-a\] \[-f\] \[-v\] \[-?\]
   volume drive letter or mount point (d: or d:\vol\mountpoint)
   -a Analyze only
   -f Force defragmentation, even if free space is low
   -v Verbose output
   -? Display this help text
Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.