
Tip: You can also use some third-party professional disk defragmentation tools to defrag disks.

You can replace c: with any drive letter on your computer to analyze or optimize other drives of your PC. For instance, you can type defrag –c to defragment all volumes on your computer, type defrag c: -a to analyze the C: drive, type defrag c: -w to perform a full defragment, type defrag c: -f to force the defragment when the free space is less than 15% on the C partition, etc. Then you can type the corresponding command lines to analyze or defrag the hard drives.Type defrag.exe or defrag -? in Command Prompt and press Enter to list all the command line parameters of the Windows defragment tool.Press Windows + R, type cmd, and press Ctrl + Shift + Enter to open the elevated Command Prompt.Next, you can select the target drive you want to optimize and click the Optimize button to optimize the drive to make it work more efficiently.Alternatively, you can also press Windows + S, type defrag, and select the Defragment and Optimize Drives App to open this tool. Press Windows + R, type dfrgui in the Run dialog, and press Enter.How to Use Defrag Command to Defrag a Windows 10/11 PC On Windows 10/11, you can use the defrag command via Windows Run or Windows Command Prompt to defrag Windows 10/11.


It also uses compaction to release more free space for the disk. This process organizes the contents of the mass storage device and stores the files in the smallest number of contiguous regions.
