By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Suggestions for Compare Folder Tree routine


I was wondering if anyone already had a script or utility that would escentially copare folder trees, like this:

CompareTrees /S1=C:\TopFldr1 /S2=D:\Charles\TopFldr2 /D=3 /Delete=Yes /When=Yes /ByByte=Yes /CASE=Yes

The routine would start for each fies in and under the folder specified by the /S1= parameter would see if the same file existed in the same folder tree starting at the /S2= parameter existed, had the:

- same date/time (/When=Yes (would check for each YMDHMSD),
- same file name (/CASE=Yes),
- and the same contents (either by a byte by bype comparison or the CRC32 vaue,
- if /Delete=Yes is specified - the file in the S1 tree would be deleted.
- the /D=3 would make sure the rightmost number of folder names was the same.

The reason why I would like this is that I use DoubleKillerPro.exe from Big Bang Enterprises but it it does not also compare folder trees - which at times is important to me.
I have a routine that does something similar. To compare file bodies, I use TCC's @compare function, which is more efficient in case of mismatch (it stops reading both files at the first mismatch, while any hash function must completely process both files, and has a miniscule probability of a false match), and probably faster even in case of a match - no need to hash. It has the option to iterate through the whole directory (not folder) tree. It reports files only in tree 1, files only in tree 2, files identical in the two trees, and files that differ. Since it is a TCC batch program, operating on Windows file systems, file names and paths are not case sensitive.
thnak you for the reply Steve. I'd be interested in looking at a copy of the routine please.....
It needs a little clean-up, because currently it assumes that it copies from F: to Z:, with source and target directories named identically - originally intended to back up selected directories from my desktop to my laptop. I myself now want it to work with arbitrary top levels for the source and the target tree.
Please keep me in mind when you get to a SHAREable state.... !!

Similar threads