【发布时间】:2015-07-16 11:20:52
【问题描述】:
【问题讨论】:
-
我只想根据目录的内容生成一个校验和。
-
是的,它是一个文件名列表及其日期和大小。你能改变一下吗:@echo off for /r %%f in (*) do md5.exe %%f >> output.txt
标签: windows batch-file md5 checksum
【问题讨论】:
标签: windows batch-file md5 checksum
@echo off
set directory=.
dir /s "%directory%" >"%temp%\filelist"
md5 "%temp%\filelist" >> output.txt
del/q "%temp%\filelist"
.,第一个命令行参数使用%~1)md5 此文件的哈希值附加到当前目录中的output.txt 【讨论】:
powershell 方式如下:
Get-ChildItem -Recurse . -File | Get-FileHash -Algorithm MD5 | Format-Table -Wrap | Out-File -Append <File_Path>
或者如果你只想要文件哈希:
Get-ChildItem -Recurse . -File | Get-FileHash -Algorithm MD5 | Select-Object Hash | Format-Table -HideTableHeaders | Out-File -Append <File_Path>
【讨论】: