Page 4 of 4

Re: HASHSUM.BAT v1.6 - emulate md5sum, shasum, and the like

Posted: 01 Aug 2020 02:32
by Michael513
Thanks for the batch file

I want to do something that's simpler and less complex, ideally, I want the process to be like

Code: Select all

set correctMD5=c6e160e565a0b5764cf70ed258b9ffd9
if "C:\program\config.ini" equals %correctMD5% goto :step1
if not "C:\program\config.ini" equals %correctMD5% goto :step2

Re: HASHSUM.BAT v1.6 - emulate md5sum, shasum, and the like

Posted: 01 Aug 2020 14:11
by dbenham
There is nothing complicated about it - the original post in this thread shows the basic technique. Just a few minor tweaks to get your behavior:

Code: Select all

echo %correctMD5% *C:\program\config.ini | hashsum /c /q && goto :step1 || goto :step2
Just be sure to put an asterisk before your file path, and don't use any quotes, even if there are spaces in the path. Windows automatically strips any trailing spaces from the name.


Dave Benham

Re: HASHSUM.BAT v1.6 - emulate md5sum, shasum, and the like

Posted: 01 Aug 2020 15:05
by Michael513
I just didn't know how to connect the two codes together, thank Sir Dave!