Skip to main content

Command line version

You can also control defragmentation through the command line version of O&O Defrag.
This makes it possible, for example, to integrate it into scripts that run automatically at system startup after user logon.

  • When started via the command line, the graphical interface is not displayed.
  • An icon appears in the task tray, and progress can be tracked in the DOS prompt.
  • O&O Defrag runs in the background independently of the interface and prompt.

If you close the DOS prompt or stop the process with CTRL-Break/CTRL-C, you can choose:

  • Let the process continue running in the background
  • End the process immediately
tip

If you start O&O Defrag via the command line, you can launch the graphical interface at any time. It will display the current status without interruption.

Invocation​

The O&O Defrag command line accepts the following commands and parameters:

OODCMD {C:[,] | ... | Z:} | {/{<action>}:{C[,] | ... | Z | ALL}}
[/OUTPUTFILE:] [/SILENT] [/NOHEADER] [/NOWAIT] [/WAITKEY]

where one of the following actions must be specified:

ANALYSIS, OPTIMIZE, QUICK, COMPLETE, COMPNAME, COMPACC, COMPMOD, FRAGFILES, SPACE, STEALTH

Parameter overview with examples​

SyntaxDescriptionExample
/ANALYSIS:{C[,] | ... | Z | ALL}Analyzes the specified drives. Results in prompt or file (via /OUTPUTFILE).OODCMD /ANALYSIS:C
/OPTIMIZE:{C[,] | ... | Z | ALL}Starts the OPTIMIZE defragmentation.OODCMD /OPTIMIZE:C,D
/QUICK:{C[,] | ... | Z | ALL}Starts the OPTIMIZE/Quick defragmentation.OODCMD /QUICK:C
/COMPLETE:{C[,] | ... | Z | ALL}Starts the OPTIMIZE/Complete defragmentation.OODCMD /COMPLETE:ALL
/COMPACC:{C[,] | ... | Z | ALL}Starts the COMPLETE/Access method (no drive zones).OODCMD /COMPACC:C
/COMPMOD:{C[,] | ... | Z | ALL}Starts the COMPLETE/Modified method (no drive zones).OODCMD /COMPMOD:D
/COMPNAME:{C[,] | ... | Z | ALL}Starts the COMPLETE/Name method (no drive zones).OODCMD /COMPNAME:C
/FRAGFILES:{C[,] | ... | Z | ALL}Outputs a list of fragmented files.OODCMD /FRAGFILES:C
/INFO:{C[,] | ... | Z | ALL}Displays drive information.OODCMD /INFO:ALL
/NOHEADERSuppresses display of program information.OODCMD /ANALYSIS:C /NOHEADER
/NOWAITStarts operation, CLI exits immediately.OODCMD /OPTIMIZE:C /NOWAIT
/OUTPUTFILE:<path>Redirects output to a file.OODCMD /ANALYSIS:C /OUTPUTFILE:C:\analysis.txt
/SILENTSuppresses all output.OODCMD /OPTIMIZE:C /SILENT
/SPACE:{C[,] | ... | Z | ALL}Starts the SPACE defragmentation.OODCMD /SPACE:C
/STEALTH:{C[,] | ... | Z | ALL}Starts the STEALTH defragmentation.OODCMD /STEALTH:D
/SSDOPTIMIZERGentle optimization for SSDs.OODCMD /SSDOPTIMIZER:C
/STOP:{C[,] | ... | Z | ALL}Stops running operations.OODCMD /STOP:C
/TRIMSends TRIM command to SSD.OODCMD /TRIM:C
/THINPROVOptimizes VM disk thin provisioning.OODCMD /THINPROV
/WAITKEYWaits for a key press after completion.OODCMD /ANALYSIS:C /WAITKEY
note

Some methods (COMPLETE/Access, COMPLETE/Modified, COMPLETE/Name, SPACE, STEALTH) do not support speed zones.