How can I generate a hash value for a file or folder?

John Savill

May 15, 2005

1 Min Read
ITPro Today logo in a gray background | ITPro Today

A. You might encounter situations in which you want to ensure that a file is the same version and has the same content as another file (e.g., when you send a file to someone, you want to make sure it hasn't been corrupted or altered). A hash is an alphanumeric string that's generated according to a file's contents. If the file has been changed in any way, the hash value changes as well.Microsoft created a utility to generate hash values, which you can download at http://download.microsoft.com/download/c/f/4/cf454ae0-a4bb-4123-8333-a1b6737712f7/windows-kb841290-x86-enu.exe. The program, which extracts to a folder that you specify, consists of a readme file and the fciv.exe image, which generates the hash values. For example, to generate a hash for a single file, use this command:

fciv d:tempyodapepsi.mpgAfter you enter the command, you'll see the following on-screen message, the generated hash value, and the corresponding filename: //// File Checksum Integrity Verifier version 2.05.//253f066ffa7c50e1e03fa588f23e3230 d:tempyodapepsi.mpg

To generate hashes for every file in a folder, simply specify the folder name, as this example shows:

fciv d:tempThe command outputs information similar to this on screen: //// File Checksum Integrity Verifier version 2.05.//5d5d1f14c8704e935a87ad78fc535bea d:temp70298Training.pdf8658bf85ba3ebe184c6d5cd0269a9e89 d:tempBO-DFRS Transcript.doc427048a497768d91cd57e29fb0199d2b d:tempBODFRS Live Meeting.wmv253f066ffa7c50e1e03fa588f23e3230 d:tempyodapepsi.mpg

The readme file contains more examples of how to use fciv.exe, including using different algorithms and generating hash values for entire tree folders.

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like