A nice enhancement of this would be to see if the current Clipboard text matched /^\s*[a-f\d]{32}\s*$/i and, if so, popping up a nice MsgBox saying whether the file dropped had the same md5 as what was in the clipboard.

Or something more elaborate, such as parsing the clipboard text for stuff that looks like:

MD5 (example_1) = bea8252ff4e80f41719ea13cdf007273 MD5 (example_2) = e0675e728056818b0392c0c2f5478ff0
(Or whatever format is used by the md5 program all the cool kids are using these days) And then forming relative filenames so that one just has to copy a chunk of MD5 statements like the above, and drag one of the files in the directory over onto the icon.

Note that another fine use of the script as-is is to drop a shortcut to it in one's SendTo folder in the %USERPROFILE% directory, or added to the context menu of every file by loading a registry file such as:

Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\*\shell] [HKEY_CLASSES_ROOT\*\shell\Calc MD5] [HKEY_CLASSES_ROOT\*\shell\Calc MD5\command] @="C:\\Perl\\Perl.exe c:\\where\\ever\\CalcMD5.pl \"%1\""

Update: I've now gone and investigated the output of various md5 utilities, and have this to report:

Hopefully, covering that mess will cover all that's needed.

--
@/=map{[/./g]}qw/.h_nJ Xapou cets krht ele_ r_ra/; map{y/X_/\n /;print}map{pop@$_}@/for@/

In reply to Re: Calc md5 for file by drag and drop (Windows) by fizbin
in thread Calc md5 for file by drag and drop (Windows) by GrandFather

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.