Welcome to TreeComp

Thank you for using TreeComp!

TreeComp is an interactive utility to keep two directory trees and the files within the directories in sync. The combined tree is displayed using a treeview control with icons indicating the status per directory. Programs to view the differences (i.e. Microsoft's WinDiff, ExamDiff , WinMerge or any other program for visual file comparison) between files with the same name can be launched by double-clicking, as well as editors for a file residing in one of the two trees. After inspection files can be copied, moved or deleted as desired. It is an indispensable tool for people sharing a pool of source files, measurement data or articles. It can be used to perform and verify backup operations, recover lost DLL's by comparing a good and a damaged system and lots more!

Getting started

Inspecting the differences

Moving files around

Moving directories around

Using filters

Integrated FTP client

Integrated ZIP and RAR support

Managing profiles

Advanced features

Snapshot functionality

Command-line interface

Example batch file

Refreshing

More information


Comparing trees

Getting started

When TreeComp is started for the first time, it should show up like this:

To start the tree comparison the directories to compare need to be specified. To do this, go to "File" | "Select Directories" or click on the top-right panel. This will show the following dialog.

Select the directory you want to compare by browsing to the appropriate folder. Repeat this procedure to select the second directory. As an alternative, the names of the directories to compare can be typed in in the comboboxes at the bottom. When ready, click the OK-button or press <Enter> to run the comparison.

After this, the program will ask how to run the comparison, as shown in above screendump. There are several ways to compare the files within the tree. The fastest way is a comparison based on any combination of time stamp, attribute and size. The slowest but most thorough way is to compare time stamps, attributes, sizes and contents. This way, the contents of all files are compared, together with the time stamps, attributes and sizes. Every combination of time stamp, attribute, size and content is supported.

When a comparison is performed based on any combination of time stamp, attribute and size, the program allows for both single-threaded and multi-threaded operation. For most applications the multi-threaded option will be faster, but for specific file structures it might be possible that the single-threaded option outperforms the multi-threaded one. By default, the multi-threaded option is selected. Furthermore, some FTP servers can only be contacted in single-threaded mode because they do not allow multiple open connections.

After selection of one of the 16 modes, pressing "Yes" will start the comparison. No files will be copied now, this button only runs the comparison and will present an overview of the differences between the trees. When "No" is selected, it is also possible to modify other settings and then start the comparison by selecting the first menu item under "Compare Trees". Selecting "More options" also allows for selecting the way the comparison should be performed.

Profiles

If you plan to compare the specified set of directories in the future, it is a good idea to press the "Save Profile" button. This option enables you to restart the same scan at a later moment. A dialog will pop-up that asks for a descriptive name of the set of directories. After doing so, you return to the "Start Scan?" dialog.

A more advanced option is in the middle of the "Select directories"-dialog. The "Smart select" checkbox specifies whether the program should perform 'intelligent' behaviour when a directory is selected from one of the comboboxes in the lower part of the dialog. The program saves the pair of directories that were compared previously and can then restore the associated directory in the other combobox. I.e. if at day 1 a comparison was done between "C:\Program Files" and "X:\Program Files" (amongst other comparisons) and you now restart the program on day 2, selecting "X:\Program Files" in the right combobox will automatically restore "C:\Program Files" in the left combobox when the checkbox in the middle is checked and the text above it says "Smart select".

After the scan is done, the treeview can be collapsed or expanded using the toolbutton [image] at the top of the treeview.


Inspecting the differences

When the comparison is performed you can view the differences withing the tree. As with the good old Windows Explorer selecting a directory displays the files within both directories for the selected folder pair. A screendump of the program after a comparison might look like this:

The colors in the tree view represent the state of the directory, while the colors in the list view represent the state of the file. The icons per directory should be interpreted as follows:

blue bullet: the directory exists on the left-hand side only (i.e. "...\Example 1").

red bullet: the directory exists on the right-hand side only (i.e. "...\Example 2").

purple bullet: the directory exists on both sides and their contents differ.

black bullet: the directory exists on both sides and their contents are equal.

The icons per file should be interpreted as follows:

blue bullet: the file exists on the left-hand side only.

red bullet: the file exists on the right-hand side only.

mixed color arrow pointing to the left: the file exists both left and right and the right file is newer.

mixed color arrow pointing to the right: the file exists both left and right and the left file is newer.

black bullet: the file exists both left and right and the files do not differ. Only visible if the toolbutton with the black bullet is down.

purple bullet: the file exists on both sides but their sizes or attributes differ while the time stamps are identical.

The status bar at the bottom shows the details for the selected folder.

To inspect the differences per file a program should be available that can compare 2 files graphically, e.g. Microsoft's Windiff.exe. Make it known to TreeComp by entering its name using "File" | "Preferences" under "File Comparison Utility".

If this setting is correct, double-clicking a file that exists on both sides or selecting "Compare File" from the context-menu will launch that program.

A file that exists on a single side only will launch the editor that is specified under "Editor" in the "File" | "Preferences" dialog.


Moving files around

Copying files using TreeComp is a two-step procedure: firstly select the file(s) that need to be copied and secondly tell the program what should be done with the selected file(s).

Selecting a file is done by clicking the file in the listview. If more files should be selected, hold down CTRL, and then select other files. If the files that are consecutive hold down SHIFT, and then click on the last file. A file can be deselected by pressing CTRL+space. A series of files having the same icon can be selected by single clicking the corresponding icon on one of the toolbars at the top or its associated shortcut key combination, e.g. CTRL+L or CTRL+R will select all files that exist on both sides as indicated in the screendump below.

Pressing one of these buttons while files are selected will pop up a dialog before a copy/delete operation will be started to ask for confirmation. A toolbutton with a cross through it should be clicked in order to delete the files matching the underlying icon, i.e. pressing a crossed out blue button without any files selected will select all blue files, pressing it for the second time will pop up a dialog whether the selected files actually should be removed. Similar options are available in the context-menu.

A way of copying files that is not possible using a toolbutton is "Copy less recent". This is designed in this way because it is not likely that a less recent file is better than a newer one.


Moving directories around

A subdirectory and its entire content can be copied if the target directory is non-existent or empty. This is done by selecting "Copy directory" from the context menu of the treeview.

Other options like renaming or creating directories are also accesible using this context menu. Selecting "Delete directory left" or "Delete directory right" will ask if the masked files should be included, too. If not switched off using "File" | "Preferences" a dialog will pop up with a list of all files and directories that are about to be removed.

To synchronize the left tree to the right tree, select "Advanced" | "Synchronize from Left to Right" from the context menu of the treeview:

This will display the following dialog:

Here, you can switch on or off specific parts of the synchronization. If not switched off using "File" | "Preferences", TreeComp will first display a confirmation dialog after pressing OK. "Advanced" | "Synchronize from Right to Left" does the same as "Synchronize from Left to Right", but in the reverse direction. Be very careful using these options!

With the backup checkbox ticked all files that are about to be overwritten or deleted will be copied to the folder .\obsolete\yyyy-mm-dd first. After this, they will be overwritten or deleted if needed.


Using filters

TreeComp supports the use of filters to hide information or to make a comparison faster. There are 2 types of filters, File filters and Directory filters, that work slighly different. The filters are specified under "File" | "Preferences" and should be semi-colon (;) seperated. Asterisk-wildcards (*) are supported. Files and directories can both be filtered in and filtered out.

File filters

To avoid having to deal with machine generated files, like temporary files or object files created by a compiler, file filters for filtering out can be applied. The status of files matching a filter out-mask is not incorporated in the treeview, and by default they are not listed in the listview at the right. These files, however, can be inspected by pressing the black bullet button above the middle of the listview. An example of a reasonable file filter is "*.obj;*.res;*.~*".

If you are only interested in certain kinds of files, for instance C++ source files with extension .cpp, the in filter can be set to "*.cpp". Using this mask only the .cpp files determine the icon status of each treeview node, and files with other extensions can be inspected by pressing the black bullet. By default the file in filter is set to *.*.

The interpretation of the icons of the masked files is similar to that of the icons of non masked files. The only difference is that they are partially obscured by horizontal bars.

Directory filters

A directory matching an out filter is not present in the treeview and there is no way to view its content. Only directories matching the in-filter are compared. An example of a reasonable directory out filter is "Obsolete;Obj", while the directory in filter is mostly set to *.*.

On the fly filtering and Explorer buttons

If a group of files is not of interest, it can be hidden by pressing one of the toolbuttons in the middle. Pressing the toolbutton with the blue bullet down will hide all the files existing only on the left side, while pressing the black button down will hide all the files without differences and the masked files. The toolbars with the red button and the arrowed buttons work similar as the blue button. On the toolbar it is also possible to open Windows Explorer by pressing one of the yellow icons. The one on the left will launch Windows Explorer for a file or folder in the tree on the left side, the one on the right will open Explorer in the tree on the right side.


Integrated FTP client

TreeComp can also compare files between a local drive or network connection and an FTP server, ideal for updating homepages at an Internet Service Provider's FTP server. The built in FTP client handles all the requests transparently. The only thing that needs to be done is specifying the name of the FTP server, the username, the password and the initial directory on the server in the FTP tab. Furthermore, the port on which the FTP server is running can be specified (default: 21) and a correction (in hours) for the time zone the FTP server uses for reporting time stamps.

The only difference encountered lies in the fact that remote files are first downloaded to the local hard drive before edited/opened as a temporary file. Modifications to the temporary files are not mirrored to the FTP server!


Integrated ZIP and RAR support

Another feature of TreeComp is its capability to compare trees within ZIP and RAR files. Just specify the name of the ZIP, RAR file or self-extracting EXE-file in the "Select directories" dialog.

As with the integrated FTP client, the only difference encountered lies in the fact that files residing in a ZIP file are first extracted to the hard drive before edited/opened as a temporary file. Modifications to the temporary files are not mirrored to the ZIP file!


Managing profiles

TreeComp 3.8 and higher support the use of profiles. Because it is very likely that you want to compare the same set of directories in the future, TreeComp enables you to restart the same scan at a later moment. To add a profile, press the "Save Profile" button in the "Start Scan?"-dialog, for specifying a descriptive name for the set of directories. At a later moment, you can restart the same scan with the same comparison mode as you used before by selecting the name of the profile from the 'File' | 'Profiles' menu. To rename or remove profiles, select 'Edit Profiles' from the 'Profiles' menu. This will show the following dialog:

The options 'Delete', 'Rename' are activated after selecting a profile. The same options are available from the context menu.


Advanced features

Select "File" | "Preferences" to configure TreeComp the way you like it:

Editor

Enter the name of your favorite editor that TreeComp should launch when "Edit" is selected from the context menu of the listview. The same editor will be launched after a file that exists on a single side is double-clicked.

File Comparison Utility

Enter the name of your favorite file comparison utility that TreeComp should launch when "Compare File" is selected from the context menu of the listview. The same program will be launched when a file which exists on both sides is double-clicked. TreeComp will also launch this program for a selected folder when "Start Comparison Utility" is selected from the context menu of the tree view on the left-hand side.

Explorer

Specify here which "Explorer"-program should be called to investigate a directory using an external program when selecting "Explore" using the treeview or listview's context menu.

Explorer Command-Line

This input field specifies which options should be passed to the program to start it in the selected directory. By default, Windows explorer is started using "/n,/e," as command-line switches, that will always start a new explorer (i.e. any other running explorer is left alone), having both a treeview and a listview. More options are described at the Microsoft site .

Proxy for FTP

To access an FTP server though a proxy server, its name can be specified here in the form 'http://<proxy-server>:<port>'. The server should be accessible using WinInet FTP APIs. Leaving this field blank will retrieve the proxy or direct configuration from the registry. Please note that this option was never tested, because a suitable test environment was not available!

Filters

See the section 'Using filters' to understand filtering.

Files are 'old', if older than ... days

Here, you can specify the age in days of files that TreeComp should hide when the checkbox 'Hide old files' on the main TreeComp window is checked. This way, you can exclude all older files that you don't want to look at.

Filter Daylight Saving Time Differences

This option only has effect if the timestamp is included in the comparison. By checking this box, files having a different timestamp but the disparity equals a whole number of hours are qualified as equal as far as timestamp concerns. I.e. a file on the left side dated 12/30/2000 22:30 is said to be equal to a file on the right side dated 12/30/2000 23:30. This is done to get rid of 'arrow' icons due to different regional settings of various computers. This option is checked by default.

Display Date in yyyy-mm-dd Format

When this box is checked, file dates are shown in ISO 8601 notation as yyyy-mm-dd, i.e. a file last modified April 25, 2007 will be displayed as 2007-04-25. If this box is unchecked the locale setting for displaying dates is used instead. This option is checked by default.

Show Confirmation Dialog

This checkbox specifies if operations that perform a file system modification will be preceded by a dialog asking for confirmation. This option is checked by default.

Ignore Attributes of Target File

If this box is checked, the attributes of target files in a file system modification are reset before the operation is started, i.e. if a file is marked read-only, the read-only attribute is removed before it is overwritten. This option is unchecked by default.

Move Local Files to Delete to Recycle Bin

If this option is checked, local files on non-removable drives that would otherwise be deleted are moved to the Recycle Bin instead. This option is by default unchecked.

The "Advanced..." button

The "Advanced..." button right-below will pop up a dialog to specify programs that should be called when binary files are convertible to ASCII before launching the Windiff-program. This is a convenience option; not specifying anything here will do no harm. An example of a program that is useful here is Borland's "Convert.exe" that converts .dfm-files to ASCII.

The editboxes have the following meaning. Suppose that you have a program that converts MS-Word .doc files to ASCII called "C:\Win32App\doc2asc.exe" you can fill in ".doc" under "Extension:", "C:\Win32App\doc2asc.exe" under "Program:", and "%p %q" under "Arguments:". "%p" stands for the name of the .doc-file that will be compared "%q" stands for the temporary output-file. If the program produces a file having the same base name as the .doc file but with a .txt-extension, you need to specify "%p %pp.txt". Finally, select "Add / Modify" to store the information.

File attributes display

File attributes are displayed by selecting "Options" | "File attributes". If a comparison is done based on sttribute (possibly among others) this option is automatically switched on.

Drag and drop support

To copy files from TreeComp 3.8 and higher to an Explorer window, just select the files you want to copy and drag and drop them to the directory of your choosing!


Snapshot functionality

With TreeComp 3.8 and higher it is not only possible to compare a set of directories at this moment, but it is also possible to track changes in time! For instance, you can find out which files and directories are changed on your hard-disk after you created your last snapshot. Creating a snapshot is easily performed by selecting 'Select Directory for Snapshot' on the 'File' menu. Here you can specify which directory (or even entire drive!) to record.

For comparing the snapshot to the current situation, select the name of the snapshot-file (*.TCS-file, or TreeComp Snapshot-file) in the "Select directories" dialog at the Zip/Rar tab. This file can be located in the "Snapshots" directory, that is created as a subdirectory of the %APPDATA% directory, usually C:\Documents and Settings\<user name>\Application Data\Snapshots (XP), C:\Users\<user name>\AppData\Roaming\Snapshots (Vista and Windows 7).


Command-line interface

TreeComp has support for command line argument passing according to the following format:

TreeComp.exe

[<LeftDirectory> <RightDirectory>|/PROFILE:<profile>]

[/NOGUI]

[/TIMESTAMP]

[/CONTENT]

[/ATTRIBUTE]

[/SIZE]

[/LOGSTATUS] [/SYNCHRONIZE_LEFT_TO_RIGHT|/SYNCHRONIZE_RIGHT_TO_LEFT|/COPY_LEFT_TO_RIGHT|/COPY_RIGHT_TO_LEFT|SYNCHRONIZE_TWO_WAY] [/KEEP_RECENT]

[/QUIT_WHEN_CLEAN]

[/QUIT_WITH_CONFIRMATION]

[/SINGLETHREADED]

[/BACKUP]

[/SNAPSHOT]

[/MD5]

[/SUMMARY:<file name>].

These options are listed here on multiple lines for clarity, but of course they should be passed on a single line, e.g.:

TreeComp C:\dir1 D:\dir2 /SYNCHRONIZE_LEFT_TO_RIGHT

TreeComp will start the comparison between the directories specified by the first 2 arguments without user interaction if both directories are found, based on the specified /TIMESTAMP, /CONTENT, /SIZE and /ATTRIBUTE flags. If none of these 4 flags is passed, the comparison is done based on timestamp and size, in multi-threaded mode. To force TreeComp to do the comparison in single-threaded mode, pass /SINGLETHREADED on the command line.

Alternatively, TreeComp can be started by referring to an existing profile, see the section Comparing trees and Managing profiles .

When /QUIT_WHEN_CLEAN is also passed, the program exits after synchronization finished (or the comparison is finished). The option /QUIT_WITH_CONFIRMATION will show a dialog including the number of files copied and deleted before closing the program.

If /LOGSTATUS is specified all the status messages are logged to <Windows temp dir>\TreeCompLog.txt, usually C:\Temp\TreeCompLog.txt.

For /SUMMARY a short summary of all files is listed to the specified file name.

If /SYNCHRONIZE_LEFT_TO_RIGHT or /COPY_LEFT_TO_RIGHT is passed TreeComp will automatically synchronize the left tree to the right tree WITHOUT ANY CONFIRMATION, i.e. it removes directories existing on the right side only and copy all files from the left side that exist both on the left and the right side. /SYNCHRONIZE_RIGHT_TO_LEFT and /COPY_RIGHT_TO_LEFT do the same, but in the reverse direction. The option /SYNCHRONIZE_TWO_WAY will copy the most recent files from either side. Be very careful using these options! When /BACKUP is also passed, TreeComp will first copy each file that will be overwritten to a subdirectory called 'Obsolete'\<current date>. The option /KEEP_RECENT will not overwrite files that are more recent on the target location.

By passing /NO_GUI TreeComp will not show it's main screen during synchronization. Instead, an icon will appear in the System Notification Area (System Tray).


Example batch file

Here is an example batch file kindly provided by Dr. Ulrich Meßmer.

@rem XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

@rem AUTOSAVE YOUR DATA WITH THE MARVELOUS TREECOMP   Dr. Ulrich Meßmer 10/2016

@rem start  this  batch  with  windows  task  scheduler  i.g.  every 15 minutes

@rem for AUTOSAVE don't forget about %1 parameter NOPAUSE

@rem XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

@rem source-drive

set srcdrv=e:

@rem destination-drive

set destdrv=c:

if not exist %srcdrv%\nul  goto error_srcdrive

if not exist %destdrv%\nul goto error_destdrive

@rem SYNTAX FOR COMMANDLINE (without win-profile, portable)

@rem /LOGSTATUS writes to <windows-temp-dir>\TreeCompLog.txt

C:\Prog_Port\TreeComp\TreeComp.exe   %srcdrv%\buffer\metasbuf       %destdrv%\buffer\metasbuf     /NOGUI /TIMESTAMP /SIZE /LOGSTATUS /SYNCHRONIZE_LEFT_TO_RIGHT /KEEP_RECENT /QUIT_WHEN_CLEAN

@rem debug

@rem pause

C:\Prog_Port\TreeComp\TreeComp.exe   %srcdrv%\buffer\metasbuf.sav   %destdrv%\buffer\metasbuf.sav /NOGUI /TIMESTAMP /SIZE /LOGSTATUS /SYNCHRONIZE_LEFT_TO_RIGHT /KEEP_RECENT /QUIT_WHEN_CLEAN

@rem debug

@rem pause

C:\Prog_Port\TreeComp\TreeComp.exe   %srcdrv%\buffer\mmkrbuf        %destdrv%\buffer\mmkrbuf      /NOGUI /TIMESTAMP /SIZE /LOGSTATUS /SYNCHRONIZE_LEFT_TO_RIGHT /KEEP_RECENT /QUIT_WHEN_CLEAN

@rem debug

@rem pause

C:\Prog_Port\TreeComp\TreeComp.exe   %srcdrv%\buffer\mmkrbuf.sav    %destdrv%\buffer\mmkrbuf.sav  /NOGUI /TIMESTAMP /SIZE /LOGSTATUS /SYNCHRONIZE_LEFT_TO_RIGHT /KEEP_RECENT /QUIT_WHEN_CLEAN

@rem debug

@rem pause

@rem verify windows temp-dir onscreen

@rem echo  %temp%

copy %temp%\TreeCompLog.txt %destdrv%\buffer\log

goto end

:error_srcdrive

@echo off

echo:

echo:

echo:source-drive %srcdrv% missing

echo:

echo:

if "%1" == "NOPAUSE" goto next1

pause

:next1

@echo on

goto end

:error_destdrive

@echo off

echo:

echo:

echo:destination-drive %destdrv% missing

echo:

echo:

if "%1" == "NOPAUSE" goto next2

pause

:next2

@echo on

goto end

:end


Refreshing

TreeComp is capable of detecting changes while TreeComp is running made by other programs in the watched trees under certain conditions. This feature only works when the monitoring thread is running. It is switched on and off by "Options" | "Monitoring Thread". Changes can't be detected on Windows 95/98/Me machines reached over the network and on FTP servers.

If the monitoring thread is not running, it is possible to update a single directory by selecting "View" | "Refresh" or the F5 key. If the thread is running, a refresh command will process the list of changes immediately, instead of after a 10 second interval.


More information

If you need more information, feel free to contact Lennert Ploeger or visit the TreeComp homepage .

Suggestions, remarks etc. are also welcome at Lennert's mailbox at TreeComp@xs4all.nl.

Reporting a bug

A bug can be reported by e-mail, preferably with a log-file attached. The log-file can be created by passing the /LOGSTATUS switch to TreeComp at startup or checking "Write log file" from the "Options" menu. For more details, see the 'Command-line interface'-section .

This program is distributed as freeware. If you like the program, pass it on to others!

Lennert Ploeger

February, 2010

Amsterdam

The Netherlands