Skip to main content

Command-line operation with OODCMD

OODCMD.exe controls the O&O Defrag agent from a terminal or script. Both graphical interfaces share this command-line tool. It requires a full, valid license and access to the local OODefragAgent service.

Inspect drives and analyze

Open PowerShell in the installation directory with the administrative rights required by your installation:

.\OODCMD.exe help
.\OODCMD.exe list
.\OODCMD.exe status
.\OODCMD.exe analyze C:

Analysis reports fragmentation without reorganizing files. Check the drive list before choosing a target. Supply several drive letters to address several drives, or all for every drive known to the agent.

Run an optimization

Choose a method appropriate for the drive and its configured zones. The following commands are alternatives; select the one that matches your maintenance task.

TaskPowerShell command
Run SOLID/Quick.\OODCMD.exe defrag C:
Run SOLID/Complete.\OODCMD.exe defrag C: --method solid
Run SPACE.\OODCMD.exe defrag C: --method space
Run OPTIMIZE with configured zones.\OODCMD.exe optimize C:

Analysis and optimization commands wait for completion by default. With --no-wait, success means that the agent accepted the action. Follow its progress with .\OODCMD.exe status C: --follow.

Control running work

Use .\OODCMD.exe stop C: to stop an action. The pause command toggles between paused and running; resume is an alias with the same toggle behavior. Check status before using either command.

Ctrl+C while waiting requests a stop for actions started by that invocation. A second Ctrl+C exits immediately and can leave those actions running. Inspect their status afterward.

Use scripts and graphical tools

Check $LASTEXITCODE in PowerShell or %ERRORLEVEL% in Command Prompt immediately after the command returns. See the shared command reference for options, methods, and exit codes, and script examples for unattended use.

Use the Classic UI for scheduled tasks, drive checks, SSD TRIM, and thin provisioning, and DiskCleaner.