Two modes in one exe
DirectoryCompare Pro ships as a single portable exe. It has two modes depending on how you call it:
| Mode | How to invoke | What it does |
|---|---|---|
| GUI | DirectoryComparePro.exe | Opens the full graphical interface |
| CLI | dircompare <dir1> <dir2> | Headless folder comparison — output to terminal, no window |
| Mergetool | DirectoryComparePro.exe -m BASE LOCAL REMOTE MERGED | Opens merge dialog for Git conflict resolution, exits with code |
Basic folder comparison
dircompare C:\project\v1 C:\project\v2
Shows a summary of differences: files changed, added, removed.
Compare three or more folders
dircompare C:\src C:\backup --extra-source C:\archive
Deep content comparison (hash-based)
dircompare C:\src C:\backup --deep
Uses SHA-256 hashing instead of size/date. Catches files that look identical but have different content.
Full flag reference
| Flag | Description |
|---|---|
| -h, --help | Show help and exit |
| -v, --version | Show version and exit |
| -q, --quiet | Suppress progress output — ideal for CI/CD pipelines |
| --deep | Enable deep content comparison (SHA-256 hash-based) |
| --extra-source <dir> | Add another source for N-way comparison (repeatable) |
| --export-csv <file> | Export results to CSV |
| --export-html <file> | Export results to HTML report |
| --export-json <file> | Export results to JSON |
| --filter <pattern> | Exclude files matching pattern — wildcards supported, repeatable |
| --copy-to-dir2 | Copy missing/different files to dir2 (2-source only) |
| --copy-to-dir1 | Copy missing/different files to dir1 (2-source only) |
| --limit <N> | Show only the first N differences in output |
| --no-summary | Skip summary — exit code only (0 = identical, 1 = differences) |
| --smart-alignment | Enable smart folder alignment (default) |
| --no-smart-alignment | Disable smart folder alignment |
Export examples
CSV report
dircompare C:\prod C:\staging --deep --export-csv results.csv
HTML report with filter
dircompare C:\src C:\backup --filter "*.exe" --filter "node_modules/*" --export-html report.html
N-way JSON export
dircompare dir1 dir2 --extra-source dir3 --extra-source dir4 --export-json results.json
CI/CD silent mode (exit code only)
dircompare C:\prod C:\staging --quiet --no-summary
echo Exit code: %ERRORLEVEL%
REM 0 = identical, 1 = differences found
Git mergetool setup Free
Register DCP as Git's merge conflict resolver. 3-way merge is free in Basic tier — no license required.
Step 1 — Add to your .gitconfig
[mergetool "dcp"]
cmd = "C:/path/to/DirectoryComparePro.exe" -m "$BASE" "$LOCAL" "$REMOTE" "$MERGED"
trustExitCode = true
[merge]
tool = dcp
Use forward slashes in the path, even on Windows. Replace
C:/path/to/ with wherever you extracted the exe.Step 2 — Use it
git merge feature/my-branch
# conflict!
git mergetool
# DCP opens once per conflicted file — resolve, save, close
DCP exits 0 when all conflicts are resolved and saved, 1 when cancelled. Git uses the exit code to decide whether to mark the file as resolved.
For a full walkthrough of Git branch comparison (not just merging), see the Git integration guide.
Exit codes
| Code | Meaning |
|---|---|
| 0 | Comparison complete — sources are identical (or merge saved successfully) |
| 1 | Differences found (or merge cancelled) |
| 2 | Error — bad arguments, path not found, or permission denied |