二进制比较所有文件与指定目录(和子目录)中的所有文件 [英] Binary compare all files against all files in a specified directory (and subdirectories)

查看:105
本文介绍了二进制比较所有文件与指定目录(和子目录)中的所有文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将包含在目录及其子目录中的所有文件与包含在同一目录及其子目录中的所有其他文件进行比较,并将匹配文件的路径记录为文本文件或CSV。

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.

我知道有软件工具可以做到这一点,但除非它是可用的Windows的开箱即用的,我不能在我的网络上使用它。

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.

本主题讨论在命令提示符中使用文件比较工具上的二进制标志。这个脚本的问题是它使用匹配的文件名来执行二进制比较; I.E.it在正在比较的两个目录中查找文件1。如果两个目录中都不存在File 1,则不会进行比较。

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.

我没有足够的经验,使用powershell或命令行脚本,以获得这个工作递归,没有找到一个例子。

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

我知道比较甚至300个文件本身可能需要相当长的时间,但我计划让这个东西在一个周末的后台运行。

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.

推荐答案

只是一个提示真的....而不是比较每个文件与其他,我会生成MD5校验和文件一次并比较校验和...

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...

这可能有帮助.. FCIV

这篇关于二进制比较所有文件与指定目录(和子目录)中的所有文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆