我本以为这将是一个非常简单的任务,但是我已经为此苦苦挣扎了几天,而且有些沮丧!我对Windows批处理脚本不是很熟悉,因此,如果您知道答案,请使其尽可能简单:)
基本上,我有一个Windows Shutdown脚本(.bat文件),其中我想知道两个文本文件是否相同(即它们的内容完全相同),如果是,则执行goto命令(例如goto line10)
我不知道该怎么做!非常感谢您的帮助!
最佳答案
该脚本应该工作:
fc /b file1 file2 > nul
if errorlevel 1 goto files_differ
[files are the same, do something here]
:files_differ
[files are not the same, do something here]
关于Windows批处理脚本: Perform a command if two files are the same!,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/5124243/