Windows – Recursive command-line md5 generator and verifier

batchcommand linehashingmd5windows

I want to write a batch script that has the ability to generate and verify md5 hashes of an entire directory tree. Is there any program like this for windows?

I can find many md5 programs, but they don't verify or recur.

Best Answer

so if you are familiar with the command line here are a few tools you can try:

FileList

From: http://web.archive.org/web/20151229001926/http://malektips.com:80/filelist-output-directory-csv-spreadsheet-database.html

The original URL no longer works, so the above uses the wayback machine. If you click the link that takes you to the download site it will also use the wayback machine so here is a direct link that seems to still work: https://www.jam-software.com/filelist/

filelist /?

FileList V2.0

Prints a list of all files in a file system branch

FILELIST [/OPTION] [/FILTER pattern1;pattern2;...] Path [>list.csv]

/OWNERS       Adds a coluimn with the file owners (slower)
/NOHEADER     Leaves out the column headers and only prints the raw data
/ATTRIBUTES   Includes the attributes that are set for each files
/MD5          Adds a column wit the MD5 checksum of each file
/AUTHORS      Additionally extracts name of the author from MS Office documents
/LASTSAVEDATE Additionally extracts the last save date from MS Office documents
/FILTER       Allows to specify one or more filters, separated with semicolons

For example: filelist /md5 C:\temp > list.csv

Add new files then run again filelist /md5 C:\temp > list2.csv 

or md5deep from http://md5deep.sourceforge.net/start-md5deep.html

 md5deep.exe -r C:\temp >> md5hashes1.txt modify files and run again
 md5deep.exe -r C:\temp >> md5hashes2.txt

now just compare list.csv with list2.csv either in excel or with any diff utility (Windifff for example)

otherwise go for:

MD5summer from http://www.md5summer.org/

or

hksfv from http://www.big-o-software.com/products/hksfv/