I have had these two batch files on my system forever:
sha1.bat:
:: https://superuser.com/questions/245775/is-there-a-built-in-checksum-utility-on-windows-7 :: https://www.mcbsys.com/blog/2017/03/use-certutil-to-get-file-hash/ :: Windows 7 has case sensitive Hash algorithms: MD2 MD4 MD5 SHA1 SHA256 SHA384 SHA512 certUtil -hashfile %* SHA1sha256.bat:
:: https://superuser.com/questions/245775/is-there-a-built-in-checksum-utility-on-windows-7 :: https://www.mcbsys.com/blog/2017/03/use-certutil-to-get-file-hash/ :: Windows 7 has case sensitive Hash algorithms: MD2 MD4 MD5 SHA1 SHA256 SHA384 SHA512 certUtil -hashfile %* SHA256
But I forgot to blog about [Wayback/Archive] Use Certutil to Get File Hash | MCB Systems mentioning:
on Windows 7, the hash algorithms are case-sensitive. Be sure to type, for example, “MD5”, not “md5”. On Windows 8.1 and 10, case doesn’t matter
I did mention the first link in “error: invalid object 100644” “git svn”, though only in a by-line. So thanks [Wayback/Archive] user64996 for asking and:
- [Wayback/Archive] tedr2 for answering [Wayback/Archive] Is there a built-in checksum utility on Windows 7? – Super User:
CertUtil is a pre-installed Windows utility, that can be used to generate hash checksums:certUtil -hashfile pathToFileToCheck [HashAlgorithm]HashAlgorithm choices: MD2 MD4 MD5 SHA1 SHA256 SHA384 SHA512So for example, the following generates an MD5 checksum for the fileC:\TEMP\MyDataFile.img:CertUtil -hashfile C:\TEMP\MyDataFile.img MD5Original solution by Laisvis Lingvevicius
To check if the hash is correct, you can use this Powershell one-liner:if ( $($(CertUtil -hashfile C:\TEMP\MyDataFile.img MD5)[1] -replace " ","") -eq "your_hash" ) { echo "ok" } - [Wayback/Archive] Christian Long for answering [Wayback/Archive] hashing – Is there a built-in checksum utility on Windows 7? – Super User:
powershell get-filehash -algorithm md5 <file_to_check>
–jeroen





