New Command-Line Parameters for Defrag.exe in Windows 7

Several new switches or parameters are added to the defragmentation console tool (defrag.exe) in Windows 7. The switches are /E, /H, /M, /T, /U & /X. Here is the entire list of parameters supported by defrag.exe (v6.1) in Windows 7:

Switch Description
/A Perform analysis on the specified volumes.
/C Perform the operation on all volumes.
/E Perform the operation on all volumes except those specified.
/H Run the operation at normal priority (default is low).
/M Run the operation on each volume in parallel in the background.
/T Track an operation already in progress on the specified volume.
/U Print the progress of the operation on the screen.
/V Print verbose output containing the fragmentation statistics.
/X Perform free space consolidation on the specified volumes.

Likewise, the following switches are dropped in Windows 7.  Although the following switches are not listed when running "defrag.exe /?", Defrag.exe in Windows 7 still accepts these switches. It’s not clear if they’re left for backward compatibility. Perhaps we should wait for official note from Microsoft.

Switch Description
/R Performs partial defragmentation (default). Attempts to
consolidate only fragments smaller than 64 megabytes (MB).
/W Performs full defragmentation. Attempts to consolidate all file
fragments, regardless of their size.
/F Forces defragmentation of the volume when free space is low.

One small request: If you liked this post, please share this?

One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:
  • Pin it!
  • Share it to your favorite blog + Facebook, Reddit
  • Tweet it!
So thank you so much for your support. It won't take more than 10 seconds of your time. The share buttons are right below. :)

Ramesh Srinivasan is passionate about Microsoft technologies and he has been a consecutive ten-time recipient of the Microsoft Most Valuable Professional award in the Windows Shell/Desktop Experience category, from 2003 to 2012. He loves to troubleshoot and write about Windows. Ramesh founded in 2005.

3 thoughts on “New Command-Line Parameters for Defrag.exe in Windows 7”

  1. Yes, Ramesh. The /r, /w and /f switches are deprecated. Windows 7 still accepts them for backward compatibility but they don’t do anything.

  2. So the basis for making the /w switch useless ONLY applies if you use scheduled automatic defragmentation? I love how Microsoft is forcing, without saying they are forcing, their own policies upon us. Kinda like how we its ‘recommended’ to disbale firewall and AnvtiVirus before updating… Yea, like the in house servers do that!

    Its really getting annoying the presumptions this new development is taking. Admins that ‘know everything’ and that decide whats best for systems they have nothing to do with. Lets not eeven get into why we cant update using https://, even if we buy the premium versions.


Leave a Comment