因需要对在不同位置的多个站点进行升级,手动一个个的升级又太麻烦,所以研究了下 Beyond Compare的批处理脚本实现:
脚本如下(为txt文本文件):
# 打开日志记录 # log normal "D:\CompareLog_%date%_%fn_time%.txt" 日期及时间格式: yyyy-mm-dd HH-mm-ss option confirm:yes-to-all # 设置比较标准 criteria binary # ---------------101 站点-------------- # 加载要比较的文件或文件夹,展开子文件夹,过滤掉不参与比较的文件 load "\\192.168.25.212\c$\ficg5" "\\192.168.25.101\c$\FICG5" expand all filter "-web.config" # 复制有更新的文件 select left.diff.files left.orphan.files copy left->right #sync create-empty mirror:left->right #输出报告 text-report layout:side-by-side options:display-mismatches,line-numbers output-to:"D:\MyReport_%date%_%fn_time%.txt"
调用脚本命令:
Bcompare.exe
@"
脚本文件
"