RunMe_About Get-FileHashValue

:: *****************************************************************************************************************************************************************
:: 20240103
:: 该脚本可以获取文件Hash value并自动生成一个HashValue.txt文档,可用于测BIOS Connect或测DU/DCU等需要更改xml里的Hash值的case.
:: 注意:要把所需获取Hash值的文件同该脚本放在同一路径下,才能直接运行该脚本.不然则要修改脚本有关文件的对应路径.
:: 作者: Darren Zhang
:: *****************************************************************************************************************************************************************

@echo off
echo.
echo start powershell
echo.
echo.**********************************************************************************************************************

:start
echo Please enter the file name which you want to use :
echo (Review tips: You can press "Tab" key to switch out the file name)
set /p "file="
echo.
if "%file%"=="" goto start
if exist %file% (goto Get-HashValue) else (goto COL)

:Get-HashValue
echo.
echo Start getting Hase Value ......
powershell Get-FileHash %file% -Algorithm MD5 > HashValue.txt
powershell Get-FileHash %file% -Algorithm SHA1 >> HashValue.txt
powershell Get-FileHash %file% -Algorithm SHA256 >> HashValue.txt
echo **********************************************************************************************************************
echo The Hash value of the %file% has been obtained!
goto Pause
echo.

:COL
echo.
echo **********************************************************************************************************************
echo %file% file not found!
echo.
echo ****** Please choose to continue or leave ******
CHOICE /C YN
if errorlevel 2 goto Exit
echo Please put %file% file in this path then continue!
ping 127.0.0.1 -n 5 >nul
cls
goto start

:Pause
pause

:Exit
exit

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值