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

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
mmetts
Posts: 1
Joined: 01 Nov 2019 15:24

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

#31 Post by mmetts » 01 Nov 2019 15:36

Hello, I love this script! Thanks for writing it. Recently, I got this error:
--------------------------------------------
C:\Temp>hashsum /C md5sums.md5
---------- "md5sums.md5" ----------
find: '/i': No such file or directory
find: '*.md5*': No such file or directory
*FAILED: LighthouseStudio.log
========== SUMMARY ==========
Total manifests = 1
Matched files = 0
Failed files = 1
--------------------------------------------
And, what I discovered was that the particular Windows system I was using has another `find` executable upstream in the path. In essence, your script was trying to run the Unix/Linux version of `find`. My thinking here is that the script should work on any Windows system that's reasonably healthy regardless of how the path variable has been manipulated. This is an important point because my audience likely does not have control over the path environment variable ... in fact, likely they'd have no idea what it is or what is does.

So what I did was I replaced "find " with "%WINDIR%\system32\find.exe " everywhere in the script and that seems to have done the trick.

I noted calls to other non-built-in commands (i.e. - not things like ECHO) and none of them seemed likely to me to collide with something spawned in a different ocean. In any case, I offer this for what it's worth... :) Please consider incorporating it if you will.

Thanks again for writing this script!

Best,
Mike

aGerman
Expert
Posts: 3763
Joined: 22 Jan 2010 18:01
Location: Germany

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

#32 Post by aGerman » 01 Nov 2019 16:12

Most likely you corrupted your PATH environment variable.

Steffen

pieh-ejdsch
Posts: 207
Joined: 04 Mar 2014 11:14
Location: germany

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

#33 Post by pieh-ejdsch » 03 Nov 2019 15:38

In the beginning of your script you only need to insert a single line to use the Variable Path correctly. therefore they do not have to introduce paths to any find.exe.

Code: Select all

call set  path=%%WINDIR%%\system32;%%path%%

Post Reply