CRC of a file (or string)

Ideas for new features & functions

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
Captive
Macro Veteran
Posts: 213
Joined: Sun Oct 20, 2002 8:37 pm
Location: Colorado, USA

CRC of a file (or string)

Post by Captive » Mon Jan 02, 2006 10:20 pm

(Also posted in the BugTracker)

Please add a feature to return the MD5 checksum of a file.
Example: GetFileCRC>c:blahblah.dat,result
Thanks. :-]

User avatar
JRL
Automation Wizard
Posts: 3501
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Tue Jan 17, 2006 5:18 pm

Captive,
I agree an MD5 checksum function would be nice. Until it is available here is a possible alternative. It requires a free utility file called MD5sums.exe available for download from here.
http://www.pc-tools.net/win32/md5sums/

It can be run from a DOS command line and the output redirected to a file. Therefore the results can be assigned to a variable within MS. Here is a sample script that will use md5sums.exe and display the filename and results.


IfFileExists>%TEMP_DIR%~md5sum~.tmp
DeleteFile>%TEMP_DIR%~md5sum~.tmp
EndIf
input>fname,file to view MD5 checksum...
Let>RP_WAIT=1
Let>RP_WINDOWMODE=2
Run>cmd /c C:\util\md5sums.exe %fname% > %TEMP_DIR%~md5sum~.tmp
ReadLn>%TEMP_DIR%~md5sum~.tmp,9,line
midstr>line,48,32,chksum
DeleteFile>%TEMP_DIR%~md5sum~.tmp
MDL>MD5 checksum for %fname%%CRLF%%CRLF%%chksum%


Hope this is helpful,
Dick

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts