How To Use the Command Line for More Control over Windows Defrag
The graphical version of Windows 7 Defrag utility seldom offers much control over the defragment process. If you are a power user and want more complete control over the defragmentation process in Windows 7, then Microsoft provides you with the command line version of the Defrag utility.
The command line version of Defrag (Defrag.exe) offers a number of options (command line argument or command switches) for the user to fiddle with all the features and control it offers. In this article, you will learn about the different command switches available that Defrag.exe offers you. You just need to append those switches according to your need.
How to open defrag.exe through command line?
- First, click on the Star Orb (Start Button) and type
cmdin the Start Menu Search box.
- Right-click on
cmdand select Run as administrator, to open an elevated command prompt.
- Now type
Defrag.exefollowed by the options according to your need in the following syntax:
Defrag <volume> | /C | /E <volumes> [/A | /X | /T] [/H] [/M] [/U] [/V]
Note: Defrag syntax used for Windows 7 is different from the syntax used for defrag in Windows Vista.
Explanation of all the command line options available for
<volume>The drive letter or mount point of the volume to defragment (for example, to defragment D: drive, type
d:or if you want to defrag a mount point,
/CDefragment all local volumes on the computer.
/EDefragment all local volumes on the computer except those specified.
/ADisplay a fragmentation analysis report for the specified volume without defrag¬menting it.
/XPerform free-space consolidation. Free-space consolidation is useful if you need to shrink a volume, and it can reduce fragmentation of future files.
/TTrack an operation already in progress on the specified volume.
/HRun the operation at normal priority instead of the default low priority. Specify this option if a computer is not otherwise in use.
/MDefragment multiple volumes simultaneously, in parallel. This is primarily useful for computers that can access multiple disks simultaneously, such as those using SCSI- or SATA-based disks rather than disks with an IDE interface.
/UPrint the progress of the operation on the screen.
/VVerbose mode. Provides additional detail and statistics.
Just use the switches as described above and take control over the whole defragmentation process using defrag in Windows 7.