1.4 KiB
1.4 KiB
cksgen-ps – Generate and compare MD5 checksum lists with PowerShell
To ensure the data integrity of my photo archive, I wrote a PowerShell script that identifies corrupted .jpg, .jpeg, .dng and .cr2 files by determining their MD5 checksums and comparing them with previous checks. In principle, this script can also be used for other file types.
This script is primarily intended for archived data stocks that no longer change. Of course, you can also use it for data that is being edited from time to time. In this case, one must not forget that the MD5 checksums already change if, for example, the metadata of a JPG file is edited. So the message ATTENTION: Different MD5 checksums found on the command prompt does not necessarily indicate a corrupted file.
Features
- Determines the MD5 checksums of files and writes them to the file
yyyyMMdd_HHmmss_checksum.txt. - Compares the checksums of the last two checksum files and outputs a corresponding message in the command prompt and in the log file
yyyyMMdd_HHmmss_log.txt. - Allowed file extensions can be specified.
- The number of checksum files and log files to be kept can be specified.
- The form of the time stamp in the file name of the log files and checksum files can be adjusted.
- The folder names for the log files and checksum files can also be specified.
- The command prompt will let you know which file is being processed.