Directory Compare may be run with optional items in the command line:
Options | Meaning |
dcp_file_name | Read the settings in the .dcp file called dcp_file_name |
/s directory_or_zip_file_name | Use directory_or_zip_file_name as Source |
/t directory_or_zip_file_name | Use directory_or_zip_file_name as Target |
/f pattern | Use pattern as Filter (see File patterns). If this is not included, *.* is assumed. |
/u | Update all newer files in Source |
/y | Update all newer files in Source and Target |
/m | Make Target a mirror (exact copy except for newer items in Target) of Source |
/q | Quit after performing other actions in command line |
(/S, /T, /F, /U, /Y, /M and /Q are also OK.)
If directory_or_zip_file_name or pattern contain spaces, you must enclose them between double quotes. If pattern already contains double quotes they have to be preceeded by \ (see below).
Examples (of course, you may need to include the program path explicitly):
Command line | Meaning |
dircmp name.dcp | Read the settings in the .dcp file and automatically start a Scan |
dircmp name.dcp /u | Read the settings in the .dcp file, automatically start a Scan and then update all newer files in Source |
dircmp name.dcp /u /q | Read the settings in the .dcp file, automatically start a Scan, update all newer files in Source, and then quit |
dircmp name.dcp /y | Read the settings in the .dcp file, automatically start a Scan and then update all newer files in Source and Target |
dircmp name.dcp /m /q | Read the settings in the .dcp file, automatically start a Scan, update all newer files in Source, erase items of Target missing in Source, and then quit |
dircmp /s "dir 1" | Use dir 1 as Source (notice the space) |
dircmp /t dir /f "\" a*\"/*.bak" | Use dir as Target and " a*"/*.bak as Filter |
dircmp /s dir1 /t dir2 | Use dir1 as Source, dir2 as Target, and automatically start a Scan |
dircmp /s dir1 /t dir2 /u | Use dir1 as Source, dir2 as Target, automatically start a Scan, and then update all newer files in Source |
dircmp /s dir1 /t dir2 /u /q | Use dir1 as Source, dir2 as Target, automatically start a Scan, update all newer files in Source, and quit |
dircmp /s dir1 /t dir2 /y | Use dir1 as Source, dir2 as Target, automatically start a Scan, and then update all newer files in Source and Target |
dircmp /s dir1 /t dir2 /y /q | Use dir1 as Source, dir2 as Target, automatically start a Scan, update all newer files in Source and Target, and quit |
You can get automatic backups in
unattended mode by using a command lines in the form
dircmp /s dir1 /t dir2 /y /q
or, if extra items in {\b Target} must be deleted,
dircmp /s dir1 /t dir2 /m /q
in a shortcut in the desktop, or in a batch file (that, for
instance, will be executed automatically from the startup menu,
or by means of the at command
under NT, or as a programmed task under Windows 98).