[英]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. 我需要将目录及其子目录中包含的所有文件与该目录及其子目录中包含的所有其他文件进行比较,并将匹配文件的路径记录为文本文件或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. 我意识到可以使用软件工具来执行此操作,但是除非Windows可以立即使用它,否则将不允许我在网络上使用它。
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.
IEit在正在比较的两个目录中查找“文件1”。 If "File 1" is not present in both directories, the comparison does not occur.
如果两个目录中都不存在“文件1”,则不会进行比较。
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. 我对Powershell或命令行脚本没有足够的经验,无法递归进行此工作,并且找不到示例。
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. 我知道即使在300个文件之间进行比较也可能会花费大量时间,但是我计划让该文件在周末的后台运行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.