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
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
| Syntax | Description | Example |
|---|---|---|
/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 |
/NOHEADER | Suppresses display of program information. | OODCMD /ANALYSIS:C /NOHEADER |
/NOWAIT | Starts operation, CLI exits immediately. | OODCMD /OPTIMIZE:C /NOWAIT |
/OUTPUTFILE:<path> | Redirects output to a file. | OODCMD /ANALYSIS:C /OUTPUTFILE:C:\analysis.txt |
/SILENT | Suppresses 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 |
/SSDOPTIMIZER | Gentle optimization for SSDs. | OODCMD /SSDOPTIMIZER:C |
/STOP:{C[,] | ... | Z | ALL} | Stops running operations. | OODCMD /STOP:C |
/TRIM | Sends TRIM command to SSD. | OODCMD /TRIM:C |
/THINPROV | Optimizes VM disk thin provisioning. | OODCMD /THINPROV |
/WAITKEY | Waits for a key press after completion. | OODCMD /ANALYSIS:C /WAITKEY |
Some methods (COMPLETE/Access, COMPLETE/Modified, COMPLETE/Name, SPACE, STEALTH) do not support speed zones.