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

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
Michael513
Posts: 2
Joined: 01 Aug 2020 02:21

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

#46 Post by Michael513 » 01 Aug 2020 02:32

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

dbenham
Expert
Posts: 2390
Joined: 12 Feb 2011 21:02
Location: United States (east coast)

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

#47 Post by dbenham » 01 Aug 2020 14:11

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

Michael513
Posts: 2
Joined: 01 Aug 2020 02:21

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

#48 Post by Michael513 » 01 Aug 2020 15:05

I just didn't know how to connect the two codes together, thank Sir Dave!

Squashman
Expert
Posts: 4198
Joined: 23 Dec 2011 13:59

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

#49 Post by Squashman » 08 Oct 2020 08:02

Michael513 wrote:
01 Aug 2020 15:05
I just didn't know how to connect the two codes together, thank Sir Dave!
Dave, two questions.
1) When were you knighted?
2) When did you move to England?

:mrgreen:

Post Reply