Recursive command-line md5 generator and verifier

7,904

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/

Share:
7,904

Related videos on Youtube

Synaps3
Author by

Synaps3

Updated on September 18, 2022

Comments

  • Synaps3
    Synaps3 almost 2 years

    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.

    • barlop
      barlop over 9 years
      well if you have a command line program that generates then you can take the output of it and use it to verify. And you can use the FOR /F command to get it to apply to a load of files or a directory.
    • barlop
      barlop over 9 years
      i'd probably break down this question into subquestions of A)How do I write a program that takes a file,(could be a file listing files one per row) and adds a second column to it is some sequence on rows 1-5 respectively, the sequence could be 1,2,3,4,5 Then ask B)How do I write a program that checks that the second column of the file reads 1,2,3,4,5
    • barlop
      barlop over 9 years
      Then use that principle..introducing md5 into it. Have a batch file that uses your md5 program on a file listing files with their full paths, and adds a column to it with the md5 hashes. And then have your batch file with another option, check that the file has a list of md5s you specify - that could be checking that file against another file.
  • barlop
    barlop over 9 years
    It's a good point that md5 won't check the tree structure itself, but you could have a list of files with full paths, and their md5 has. Interesting idea-zip, but i'd wonder if they ever change the algorithm very slightly or compress it slightly differently, then the hash would change. I remember pkzip for example had options like pkzip -ex (-ex was extreme compression).
  • barlop
    barlop over 9 years
    -1 He said command line. If you want to suggest a GUI answer then make that a comment, because it doesn't answer the question he asked. If he decides on GUI then he should make a new comment prompted by you making a comment, but you shouldn't write an answer that doesn't address the question he asked. This is a database of questions and answers meant to be useful for people other than just the questioner. So it's important that the answer addresses the question even if the questioner meant something else. If the questioner meant something else he should edit or ask another q.