Automate MD5 Hashing with a SendTo MD5 Context Menu Entry
Verifying file integrity with MD5 checksums is useful for downloads, backups, and transfers. Adding an MD5 option to Windows’ SendTo menu creates a one-click workflow: right-click a file, choose the SendTo MD5 shortcut, and get the file’s MD5 hash in seconds. This guide shows how to create a simple, reusable SendTo MD5 context-menu entry that generates and saves MD5 checksums.
What this does
- Adds a SendTo shortcut named SendTo MD5.
- Runs a small script that computes the MD5 hash for the selected file(s).
- Outputs results to a text file (saved next to each file or in a central folder) and optionally opens the file for quick copy/paste.
Requirements
- Windows (7, 8, 10, 11).
- PowerShell (built-in).
- No admin rights required.
Steps
- Create a folder for the script
- Create a folder to hold the script, e.g.,:
- C:\Tools\SendToMD5
- Save the PowerShell script
- Create a file named Generate-MD5.ps1 in that folder with this content:
Code
param([string[]]\(files) </span> foreach (\)f in \(files) {if (-not (Test-Path \)f)) { continue }$hash = Get-FileHash -Algorithm MD5 -Path $f $outFile = Join-Path -Path (Split-Path -Parent $f) -ChildPath ("{0}.md5.txt" -f (Split-Path -Leaf $f)) "$($hash.Hash) $($hash.Path)" | Out-File -FilePath $outFile -Encoding UTF8 Start-Process notepad.exe -ArgumentList $outFile}
- Create a SendTo shortcut
- Press Win+R, type shell:sendto, and press Enter to open your SendTo folder.
- Right-click inside the folder → New → Shortcut.
- For the item location, enter:
- powershell.exe -NoProfile -ExecutionPolicy Bypass -File “C:\Tools\SendToMD5\Generate-MD5.ps1” “%V”
- Name the shortcut: SendTo MD5
- Usage
- Right-click any file (or select multiple files), choose SendTo → SendTo MD5.
- Notepad will open with a corresponding .md5.txt file showing the MD5 and file path.
Customization options
- Save all hashes to a central log folder: change \(outFile to a fixed path like "C:\Tools\SendToMD5\hashes.log" and append instead of overwrite.</li> <li>Copy MD5 to clipboard instead of opening Notepad: replace Start-Process with Set-Clipboard \)hash.Hash.
- Use SHA256 instead: change -Algorithm MD5 to -Algorithm SHA256 in Get-FileHash and adjust file extension if desired.
Troubleshooting
- If shortcut doesn’t pass files correctly, replace “%V” in the shortcut target with “%1” for single-file operation, or use a small batch wrapper to pass multiple files.
- If ExecutionPolicy blocks the script, the shortcut includes ExecutionPolicy Bypass; ensure powershell.exe path is correct.
- For long file paths, PowerShell supports them in recent Windows builds—enable NTFS long paths if needed.
Security note
MD5 is fast but cryptographically broken for collision resistance; use it only for basic integrity checks. For stronger guarantees, use SHA256.
That’s it—once set up you’ll have a fast, repeatable SendTo MD5 entry for one-click file hashing.
Leave a Reply
You must be logged in to post a comment.