Home Enter Logo
Enter AG, Joweid Zentrum 1, 8630 Rüti ZH, +41 43 311 59 15

Enter AG - dc Download

dc - directory compare

Manual

A program to compare two directories

Copyright © 2006, Enter AG, Zurich

This program is published by the copyright owner under the GNU GPL.

It can be downloaded here.

For obtaining a license not subjected to the restrictions of the GNU GPL, please negotiate a different license with the copyright owner.

This manual is published by the copyright owner under the GNU FDL.

Author: Dr. sc. math. Hartwig Thomas.

Table Of Contents

Purpose

Prerequisites

Installation

Usage

Distribution

Development

Purpose

The script dc ("directory compare") was developed in order to facilitate the automated comparison of two directories in the Windows file system.

As opposed to programs like Windiff it is a command-line program, which will return an exit code indicating its success and writing its output to stdout and stderr. Thus it can be used by batch scripts which need to run unattended.

As opposed to any diff program that we found in the public domain it is not limited in the number of files or the size of the files in the two directories being compared.

The script dc just determines, whether all subdirectories and files of two directories are equal or not. It will indicate the first difference encountered.

Prerequisites

The script dc depends on the Windows system utility fc (file compare) being available. It is implemented in Microsoft's VBScript and can be run on any Windows system, where the Windows Scripting Host is available.

The script dc is dependent on the COM (Microsoft's Component Object Model) libraries Scripting (FileSystemObject for walking the directory) and WScript (Shell for executing fc).

Installation

The file dc.vbs just needs to be copied anywhere on the file system. No administrator's privileges are needed for istalling or running it.

Usage

On a command line enter

cscript dc.vbs /h | <dir1> <dir2>

where the file name dc.vbs should be replaced by the absolute file name of the script if it is not in the current directory.

If the option /h is entered on the command line, dc just displays a short usage notice. Otherwise the two directories <dir1> and <dir2> are being compared.

N.B.: Due to general rules for specifying command-line parameters under Windows it is advisable to put the absolute file name of the script as well as both directory names in double quotes unless they are very simple.

The script dc will compare the two directories recursively and report its result on stdout and any errors on stderr. If the two directories are equal, it terminates with an exit code 0. Otherwise a different exit code is returned.

Distribution

The script dc is distributed in a ZIP archive, which contains

dc.vbs

the script file

dc.odt

this manual in Open Document Format

gpl.txt

the GNU GPL license

fdl.txt

the GNU FDL license

Development

As dc is a simple script, it is "open source" per se. Developers looking at the code will notice, that a command-line switch /debug will turn on very detailed tracing for debugging purposes.

A "development environment" is not needed for modifying dc. A plain text editor is sufficient for this purpose.