As mentioned in this page, the command:
CertUtil -hashfile yourFileName MD5can be used to obtain the MD5 hash value for a particular file.
How can I find the MD5 hash values for multiple files in a folder using cmd?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
The standard way to run a command on multiple files in CMD
You can get usage information by typing
A simple solution for your problem is
for %F in (*) do @certutil -hashfile "%F" MD5
%F is a variable.
You can choose an letter — any single letter — for the variable name
(use the same name in both places, of course) —
and note that it is case-sensitive (
%F is not the same as
If you do this in a script, use double percent signs (e.g.,
The quotes around the second appearance of the variable (
(as suggested by nullterminatedstring’s answer)
are required if any of the filenames contain spaces.
You can put a list of filenames and/or wildcards between the parentheses; e.g.,
for %F in (file1 file2 a* b*) do …
certutil is somewhat verbose.
You may want to cut down on the chatter by saying
for %F in (*) do @certutil -hashfile "%F" MD5 | find /v "hashfile command completed successfully"
(to filter out the
command completed successfully messages).
I know you asked specifically for cmd, but if you're using Windows 8.1 or higher, consider using Powershell instead:
Get-FileHash -Algorithm MD5 -Path (Get-ChildItem "\\path\to\files\*.*" -Recurse)
The Recurse switch is, of course, optional. You can pipe it to
Export-Csv to get a list of files and their hashes.
You can use this in Windows 7, but you have to upgrade Powershell to version 4 first.