A simple method to hash file under Windows NT6

2019-03-07 - Live on and Go

Since Windows NT6, Windows started to include certification utility. This file is called “certutil.exe”. You may call it through Windows command line.

File hashing is significantly important in file checking to make sure it is not corrupted. To perform file hashing, you will need to execute following command line:

certutil -hashfile [Target File Path] [Algorithm]

For example, if you want to hash a file in “D:\test.txt” with MD5 algorithm, you are supposed to execute command line:

certutil -hashfile "D:\test.exe" MD5

In order to integrate this function to right-click button, you should write batch program and edit registry.

For batch program, you should write the following code:

@echo off

title Hash File with SHA-1 Algorithm
echo Hash File with SHA-1 Algorithm
echo Powered by

echo ============Start Hashing============
certutil -hashfile %1 SHA1
echo ============Hash Complete============


Save the code to C:\Windows\hashsha1.bat

Next, we should edit the registry. To simplify your work and make your editing safer, we are going to create a registry file.
Create a “*.reg” file, and put the following code:

Windows Registry Editor Version 5.00

@="Hash File with SHA-1 Algorithm"

@="\"C:\\Windows\\hashsha1.bat\" \"%1\""

Execute the registry editor file. Then the right-click button would start to work.
For an example, we download Notepad++ from internet. We selected to download Notepad v7.6.4 x64 installer. From official Notepad++ website, the expected SHA-1 hash result is:
You may check this from website link:

We click on the right-click button. A command line windows pops up:

SHA-1 hash result

You may notice that the most complex algorithm that certutil supports is the SHA-512 algorithm.

2 thoughts on “A simple method to hash file under Windows NT6

Claris Peterka

I’d like to find out more? I’d like to find out more details.|

Elaina Mrozek

I wanted to thank you for this good read!! I certainly loved every little bit of it. I have you bookmarked to check out new things you post…|


Leave a Reply

Your email address will not be published. Required fields are marked *