简体   繁体   English

二进制比较所有文件与指定目录(和子目录)中的所有文件

[英]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个文件之间进行比较也可能会花费大量时间,但是我计划让该文件在周末的后台运行。

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... 只是一个提示而已....而不是将每个文件相互比较,我将一次生成每个文件的MD5校验和并比较校验和...

This may help.. FCIV 这可能有助于.. FCIV

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Powershell:将指定目录中的所有文件放入单独的、唯一命名的子目录中 - Powershell: Place all files in a specified directory into separate, uniquely named subdirectories 如何删除目录和子目录中除某些文件夹之外的所有文件? - How to delete all files in a directory and subdirectories except for certain folders? 将一个父目录下的子目录中的所有文件移动到N个子目录中 - Move all files in subdirectories contained in one parent directory to N sub-subdirectories Windows打开文件对话框,其中包含所有文件+子目录 - Windows open files dialog with all files + subdirectories 如何使用CMD / Powershell查找目录(包括子目录)中的所有文件,然后显示具有某些扩展名的文件 - How to, using CMD/Powershell, find all files in a directory (including subdirectories), and then display files that have certain extensions 我可以运行与当前目录和所有子目录中的所有文件匹配的 Windows Powershell 命令吗? - Can I run a Windows Powershell command matching all files in the current directory and all subdirectories? Windows批处理文件 - 连接子目录中的所有文件 - Windows batch file - Concatenate all files in subdirectories 打印给定路径中的所有文件和子目录 - print all files and subdirectories in a give path 在所有文件和子目录中找到任何提及 google 的内容? - Find any mention of google in all files and subdirectories? 如何递归列出指定目录中所需文件类型的所有文件? - How to recursively list all files of desired file type in a specified directory?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM