最佳答案
@echo off
set directory=.
dir /s "%directory%" >"%temp%\filelist"
md5 "%temp%\filelist" >> output.txt
del/q "%temp%\filelist"
- 将指定目录下所有文件的递归列表写入临时文件
(.
用于当前目录,%~1
用于第一个命令行参数) md5
此文件的哈希附加到当前目录中的output.txt
- 临时文件被删除
关于windows - 为 Windows 中的目录生成校验和,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31452742/