windows 批量生成目录下 文件MD5

发布时间:2022-07-05 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了windows 批量生成目录下 文件MD5脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。

https://www.pstips.net/question/7744.htML

# 先保存一份清单
dir C:WindowsSystem32driversetc  -File -Recurse | Get-FileHash -AlgorIThm MD5 | ConvertTo-JSON | Out-File hash-list.json
 
# 读取保存的值
$old = Get-Content .hash-list.json | ConvertFrom-Json
 
#获取最新值
$new = dir C:WindowsSystem32driversetc  -File -Recurse | Get-FileHash -Algorithm MD5
 
#进行比较
Compare-Object $new $old

缺点文件夹带空格 ,失败 https://www.cnblogs.COM/bio-mary/p/12131684.html

title md5批量生成脚本-by miles
setlocal enabledelayedexpansion
%~d0
cd %~dp0
if exist 1234.txt del 1234.txt
for /R %%s in (.,*) do (
echo %%s
) >>1234.txt
if exist md5.txt del md5.txt
for /f "skip=1" %%a in (1234.txt) do certutil -hashfile %%a MD5>>;md5.txt

然后学习了下修改如下 可以带空格目录名了 https://www.cnbLOGs.com/Jian-Zhang/p/6066429.html

title md5批量生成脚本-by miles
setlocal enabledelayedexpansion
%~d0
cd %~dp0
if exist 1234.txt del 1234.txt
for /R %%s in (.,*) do (
echo "%%s"
) >>1234.txt
if exist md5.txt del md5.txt
for /f "skip=1 tokens=*" %%a in (1234.txt) do certutil -hashfile %%a MD5>>md5.txt

脚本宝典总结

以上是脚本宝典为你收集整理的windows 批量生成目录下 文件MD5全部内容,希望文章能够帮你解决windows 批量生成目录下 文件MD5所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。