Get Checksum (Hash) of File on Windows

Use a built-in way to get file checksums from the command line in Windows.

Use the following syntax to get the SHA1 checksum of a file.

certutil -hashfile <filename> SHA1

Help

Running the following command

certutil -hashfile -?

Will show all the options and usage for the -hashfile verb. Luckily, certutil supports the deprecated MD5 hash, which is not good for security but still has value in certain areas of IT.

Usage:
  CertUtil [Options] -hashfile InFile [HashAlgorithm]
  Generate and display cryptographic hash over a file

Options:
  -Unicode          -- Write redirected output in Unicode
  -gmt              -- Display times as GMT
  -seconds          -- Display times with seconds and milliseconds
  -v                -- Verbose operation
  -privatekey       -- Display password and private key data
  -pin PIN                  -- Smart Card PIN
  -sid WELL_KNOWN_SID_TYPE  -- Numeric SID
            22 -- Local System
            23 -- Network Service
            24 -- Local Service

Hash algorithms: MD2 MD4 MD5 SHA1 SHA256 SHA384 SHA512

CertUtil -?              -- Display a verb list (command list)
CertUtil -hashfile -?    -- Display help text for the "hashfile" verb
CertUtil -v -?           -- Display all help text for all verbs