Binary compare all files against all files in a sp

2020-04-19 06:25发布

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; I.E.it 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.

1条回答
时光不老,我们不散
2楼-- · 2020-04-19 06:42

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

查看更多
登录 后发表回答