Skip to content

Instantly share code, notes, and snippets.

@AhmadFCheema
Created September 13, 2017 14:14
Show Gist options
  • Save AhmadFCheema/51efb8ae8c8eb1d0e90615155fb56ba5 to your computer and use it in GitHub Desktop.
Save AhmadFCheema/51efb8ae8c8eb1d0e90615155fb56ba5 to your computer and use it in GitHub Desktop.
Windows context menu, Hash calculation shortcut
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\*\shell\Calculating.Hash.Checksums]
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\Calculating.Hash.Checksums]
@="Calculate hash checksums"
"Extended"=""
"Icon"="imageres.dll,262"
[HKEY_CLASSES_ROOT\*\shell\Calculating.Hash.Checksums\Command]
@="cmd /s /c pushd &(call certUtil -hashfile \"%1\" MD2 & certUtil -hashfile \"%1\" MD4 & certUtil -hashfile \"%1\" MD5 & certUtil -hashfile \"%1\" SHA1 & certUtil -hashfile \"%1\" SHA256 & certUtil -hashfile \"%1\" SHA384 & certUtil -hashfile \"%1\" SHA512) > \"%1\"-Hash.txt"
@AhmadFCheema
Copy link
Author

The registry script (CAlculating.Hash.Checksums.reg) creates a shortcut entry in extended Windows context menu (Shift+Right-Click) for quickly calculating and saving hash checksums (MD2, MD4, MD5, SHA-1, SHA-256, SHA-384, SHA-512) in a text file. The checksums are calculated through the Windows built-in Certutil program, without the need for any third-party applications.

  • To make the hash calculation option appear for normal Windows context menu (Right-Click) just remove the "Extended"="" line from code.
  • A more customised icon can be used by providing a path to it, for example, "Icon"="\"D:\\Icons\\icons8-Hash-26.ico\"". The extra backslashes (\) are to make sure the quotation marks and backslashes are included in the created registry entry.
  • I recommend the Windows 8 dark-red Hash icon.
  • Calculating.Hash.Checksums - Remove.reg code is to undo the changes and remove the hash calculation context menu entry.
  • For a cascading context menu with individual menu entries for calculating and saving individual checksum types, check out CAlculating.Hash.Checksums.Cascading.reg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment