Rob van der Woude's Scripting Pages

Batch How To ...

Generate a Cryptographic Hash for a File

 

Using native CERTUTIL

CERTUTIL is native in Windows 8 .. 11 (not sure about Vista and 7).

CERTUTIL.EXE -hashfile myfile hashalgorithm

Accepted values for the optional hashalgorithm argument are: MD2, MD4, MD5, SHA1 (default), SHA256, SHA384 or SHA512 (no dashes)

The hash value will be displayed on screen.
Use redirection to save it to a file, e.g.:

CERTUTIL.EXE -hashfile myfile.zip MD5 > myfile.md5

 

Using FCIV

FCIV is Microsoft's (unsupported) File Checksum Integrity Verifier.
It must be downloaded from a web archive and installed before you can use it.

FCIV.EXE myfile hashalgorithm

Accepted values for the optional hashalgorithm switch are: -MD5 (default), -SHA1 or -both (dashes required)

The hash value(s) will be displayed on screen.
Use redirection to save it to a file, e.g.:

FCIV.EXE myfile.zip -MD5 > myfile.md5
Note: Since FCIV is unsupported, available only from web archives, and supports only 2 hash algorithms, CERTUTIL is absolutely preferred — if available in your Windows version.

page last modified: 2023-07-01; loaded in 0.0033 seconds