Command-line parameters for Defraggler

Defraggler comes with a command-line version of the GUI program called df.exe. This program is located in the same folder as defraggler.exe, typically C:\Program Files\Defraggler.

You can pass commands to df.exe using batch files. The syntax for calling df.exe is as follows:

df.exe [file or filemask or folder or drive label] [/?] [/L] [/S] [/debug]


Parameter Description
/? Help switch: Displays a list of available parameters and provides examples.
/L Lists all drives that Defraggler can defragment on this computer.
Defragments the specified drive.
Defragments the specified file or folder. You can chain multiple <items> together, but they all must be located on the same drive.
For a specified folder, Defraggler will also defragment any subfolders beneath it (recursive).
/shutdown Shuts down the computer after Defraggler completes operations.
/fs Defrag Freespace - Defraggler will fill up freespace chunks with whole files only in order to reduce the level of freespace fragmentation.
/fsaf If you select Defrag Freespace (Allow fragmentation), Defraggler will use file fragments to fill up freespace. Defrag Freespace (Allow fragmentation) will defrag freespace to the highest possible level.
/analysis Performs the analysis step only, but does not defragment the drive.
/F This will force the request defrag to be performed even if the drive is detected as a solid-state drive.
/large During defragmentation, Defraggler moves large files to the end of the drive to improve performance. For more information, see this topic. Defraggler will use the existing settings on the Defrag tab of the Options dialog box.
/QD Defraggler will use the Quick Defrag process (faster, but not as efficient as regular defrag). You can only use the /QD flag when defragmenting an entire drive -- not a specific file or folder. You cannot use the /QD flag with the /large flag; Defraggler will return an error message.
/MinPercent Defrag only if fragmentation percent is at least <percentage>% - we recommend setting this to 10 to ensure that the drive is not unnecessarily defragmented when it's not needed.
/exclude_app This prevents Defraggler from running when the specified process (e.g. "iexplore.exe") is running.
Runs Defraggler in debug mode for troubleshooting purposes. Debug2 and Debug3 provide increasingly more details. See this topic for more information about the log files that debug creates.


This allows you to register the software with valid license details when entering them in the format of: /register name="<name>" key="<key>".



df.exe C:\testfile - defragments the file C:\testfile.exe.

df.exe C:\Windows /shutdown - defragments all files in the Windows folder on C:, and then shuts down the computer.

df.exe C:\Windows\*.exe - defragments all .EXE files in the Windows folder on C:.

df.exe "C:\Program Files\*.exe" C:\Windows C:\new.txt - defragments all .EXE files in the Program Files folder, all files in the Windows folder, and the new.txt file at the root of C:.

df.exe C:\ /large - defragments all files on the C: drive, and moves large files to the end of the drive.

Need to find your product license key?

Go to our license lookup page and enter your registered email address to retrieve info about your products, including product download links, license key(s), and expiry dates.

Send me my license details

Articles in this section