Verifying MD5 hashes in Batch?

后端 未结 2 762
伪装坚强ぢ
伪装坚强ぢ 2021-01-14 15:29

I am writing a batch file and I need it to verify a file\'s MD5 hash before continuing on with the script. For example:

@echo off
if MD5 equ 79054025255fb1a2         


        
2条回答
  •  长发绾君心
    2021-01-14 15:35

    try with MD5.BAT :

    set "file=c:\myfile.ext"
    call md5.bat "%file%" md5
    
    if "%md5%" equ "79054025255fb1a26e4bc422aef54eb4" (
          echo MD5 identical!
    ) else (
          echo MD5 does not match.
    )
    

提交回复
热议问题