简体   繁体   中英

Binary compare all files against all files in a specified directory (and subdirectories)

I need to compare all the files contained within a directory and its subdirectories against all the other files contained within that same directory and its subdirectories and log the paths of matching files to text file or a CSV.

I realize there are software tools to do this, but unless it is avaialable out-of-the-box with Windows, I won't be allowed to use it on my network.

This topic discusses using the binary flag on the file comparison tool in the command prompt. The problem with this script is that it uses matching filenames to execute the binary comparisons; IEit looks for "File 1" in both directories that are being compared. If "File 1" is not present in both directories, the comparison does not occur.

I need the comparison to ignore filenames and just brute force compare the current file against all other files. It needs to then move on to the next file.

I am not quite experienced enough with either powershell or command line scripting to get this working recursively and could not find an example.

I understand that comparing even 300 files amongst themselves could take a considerable amount of time, but I plan on letting this thing run in the background over the course of a weekend.

Just a hint really.... rather than comparing every file against every other, I would generate the MD5 checksum of each file once and compare the checksums...

This may help.. FCIV

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM