Difference between revisions of "Windows Batch Script to Calculate MD5 and SHA1 Digest"
Jump to navigation
Jump to search
(Created page with "== Windows Batch Script to Calculate MD5 and SHA1 Digest == Create a text file called '''hash.bat''' with the contents below and put on your desktop, you can then drop files...") |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
Create a text file called '''hash.bat''' with the contents below and put on your desktop, you can then drop files on the shortcut to calculate hash digests: | Create a text file called '''hash.bat''' with the contents below and put on your desktop, you can then drop files on the shortcut to calculate hash digests: | ||
@echo off | |||
certutil -hashfile %1 SHA1 | certutil -hashfile %1 SHA1 | ||
@echo. | |||
certutil -hashfile %1 MD5 | certutil -hashfile %1 MD5 | ||
pause | pause | ||
Alternative version that opens result with notepad: | |||
@echo off | |||
set SCRIPT_OUTPUT=%TEMP%\digest.txt | |||
certutil -hashfile %1 SHA1 >%SCRIPT_OUTPUT% | |||
@echo. >> %SCRIPT_OUTPUT% | |||
certutil -hashfile %1 MD5 >>%SCRIPT_OUTPUT% | |||
start notepad %SCRIPT_OUTPUT% |
Latest revision as of 12:07, 21 November 2017
Windows Batch Script to Calculate MD5 and SHA1 Digest
Create a text file called hash.bat with the contents below and put on your desktop, you can then drop files on the shortcut to calculate hash digests:
@echo off certutil -hashfile %1 SHA1 @echo. certutil -hashfile %1 MD5 pause
Alternative version that opens result with notepad:
@echo off set SCRIPT_OUTPUT=%TEMP%\digest.txt certutil -hashfile %1 SHA1 >%SCRIPT_OUTPUT% @echo. >> %SCRIPT_OUTPUT% certutil -hashfile %1 MD5 >>%SCRIPT_OUTPUT% start notepad %SCRIPT_OUTPUT%