Shortcut to copy file hashes to clipboard

Discussion in 'Windows 10' started by hotwire, Oct 29, 2017.

  1. hotwire

    hotwire MDL Novice

    Aug 18, 2017
    8
    13
    0
  2. GOD666

    GOD666 MDL Expert

    Aug 1, 2015
    1,958
    2,061
    60
    I see you have 7zip installed. This is included after you install 7zip. ;)
    Untitled.png
     
  3. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    16,194
    84,741
    340
    Are you sure it works? :g:
    i get cmd window, nothing in clipborad
    Code:
    SHA1 hash of file Command_Hash.reg:
    be f2 1b f3 59 b2 1d 03 21 f2 df e5 96 66 ed 4f 0e ee 83 a2
    CertUtil: -hashfile command completed successfully.
    Press any key to continue . . .
     
  4. hotwire

    hotwire MDL Novice

    Aug 18, 2017
    8
    13
    0
    #4 hotwire, Oct 29, 2017
    Last edited: Oct 29, 2017
    (OP)
    The command was extensively tested but I didn't expect this case. Somehow your certutil inserted space characters between each byte. Here is a fix.

    Code:
    Windows Registry Editor Version 5.00
    
    [HKEY_CURRENT_USER\Software\Classes\*\shell\hash]
    "MUIVerb"="Hash"
    "SubCommands"=""
    
    [HKEY_CURRENT_USER\Software\Classes\*\shell\hash\shell\1MD5]
    "MUIVerb"="MD5"
    
    [HKEY_CURRENT_USER\Software\Classes\*\shell\hash\shell\1MD5\command]
    @="cmd /c @echo off&(for /f \"tokens=*\" %%a in ('certutil -hashfile \"%1\" MD5') do echo %%a&for /f \"delims=\" %%b in ('echo %%a^|findstr /r /i /x \"[0-9A-F ]*\"') do if \"%%b\" neq \"\" set \"x=%%b\"&echo %%x: =%%|clip&pause&exit)&pause"
    
    [HKEY_CURRENT_USER\Software\Classes\*\shell\hash\shell\2SHA1]
    "MUIVerb"="SHA1"
    
    [HKEY_CURRENT_USER\Software\Classes\*\shell\hash\shell\2SHA1\command]
    @="cmd /c @echo off&(for /f \"tokens=*\" %%a in ('certutil -hashfile \"%1\" SHA1') do echo %%a&for /f \"delims=\" %%b in ('echo %%a^|findstr /r /i /x \"[0-9A-F ]*\"') do if \"%%b\" neq \"\" set \"x=%%b\"&echo %%x: =%%|clip&pause&exit)&pause"
    
    [HKEY_CURRENT_USER\Software\Classes\*\shell\hash\shell\3SHA256]
    "MUIVerb"="SHA256"
    
    [HKEY_CURRENT_USER\Software\Classes\*\shell\hash\shell\3SHA256\command]
    @="cmd /c @echo off&(for /f \"tokens=*\" %%a in ('certutil -hashfile \"%1\" SHA256') do echo %%a&for /f \"delims=\" %%b in ('echo %%a^|findstr /r /i /x \"[0-9A-F ]*\"') do if \"%%b\" neq \"\" set \"x=%%b\"&echo %%x: =%%|clip&pause&exit)&pause"
    
     
  5. Palladin

    Palladin MDL Senior Member

    Feb 1, 2014
    476
    248
    10

    I didn't know 7-zip could do that.
    Unfortunately 7-Zip doesn't automatically copy the result to the clipboard, but you can do it manually by placing the cursor in the results window, and then Ctrl-C and the the window's info *is* then copied to the clipboard.

    Thanks for the neat tip.:clap3:
     
  6. GOD666

    GOD666 MDL Expert

    Aug 1, 2015
    1,958
    2,061
    60
    Thanks for the tip. I did not know you could copy it by simply placing our cursor in the window and hitting Ctrl+C. I had tried to highlight the text and right-clicking or Ctrl+C but never could highlight it. Always thought it was puzzling that you could not easily copy the hash (figured most folks used another program). -- This bit of info will make my life easier, so thanks. :)
     
  7. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    47,245
    94,629
    450
    Did you think i manually typed the info from checksum info? ;):D
     
  8. GOD666

    GOD666 MDL Expert

    Aug 1, 2015
    1,958
    2,061
    60
    :rofl: No, I just assumed you used a different program. ;)
     
  9. dhjohns

    dhjohns MDL Guru

    Sep 5, 2013
    3,262
    1,731
    120
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. Nucleus

    Nucleus MDL Guru

    Aug 4, 2009
    2,868
    2,950
    90
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. endbase

    endbase MDL Guru

    Aug 12, 2012
    4,673
    1,708
    150
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...