✅ 方法一(最推荐):certutil(系统自带,万金油)
适用:Windows 7 / 10 / 11 / Server 所有版本
1️⃣ 打开 CMD 或 PowerShell
- 开始菜单 → 搜索
cmd - (是否管理员权限无所谓)
2️⃣ 执行 MD5 校验
cmd
certutil -hashfile 文件路径 MD5
✅ 示例
cmd
certutil -hashfile C:\temp\test.iso MD5
输出示例:
text
MD5 hash of C:\temp\test.iso:
e2fc714c4727ee9395f324cd2e7f331f
CertUtil: -hashfile command completed successfully.
👉 中间那一行就是 MD5 值
✅ 方法二:PowerShell(更现代)
Windows 10 / 11 / Server 推荐
powershell
Get-FileHash C:\temp\test.iso -Algorithm MD5
输出示例:
text
Algorithm : MD5
Hash : E2FC714C4727EE9395F324CD2E7F331F
Path : C:\temp\test.iso
✅ 优点:
- 可脚本化
- 支持 SHA1 / SHA256 / SHA512
✅ 方法三:GUI / 右键(第三方工具)
如果你经常校验文件(ISO、固件、驱动):
常用工具
- HashCheck
- 7-Zip(间接)
- HashTab
安装后 → 右键文件 → 校验和 / 属性 → MD5
✅ 适合非运维、非工程环境
❌ 服务器一般不装
✅ 方法四:WSL / Linux 工具(如果你有 WSL)
bash
md5sum /mnt/c/temp/test.iso
✅ 多算法对照(实用)
| 算法 | 命令 |
|---|---|
| MD5 | certutil -hashfile file MD5 |
| SHA1 | certutil -hashfile file SHA1 |
| SHA256 | certutil -hashfile file SHA256 |
PowerShell:
powershell
Get-FileHash file -Algorithm SHA256
⚠️ 工程注意事项(很重要)
❗ MD5 已不安全
- 不能用于安全校验 / 防篡改
- 只能用于:
- 文件完整性
- 传输是否损坏
- 与厂商给的 MD5 对比
✅ 下载 ISO / firmware / driver
- 优先 SHA256
- MD5 只是"快速对一眼"
✅ 快速对比(你实际会用到的)
| 场景 | 推荐方式 |
|---|---|
| 单次校验 | certutil |
| 写脚本 | PowerShell |
| Server / 无 GUI | certutil |
| 批量文件 | PowerShell |
| 日常桌面 | 右键工具 |
✅ 一句话总结
Windows 下 check MD5:
cmd
certutil -hashfile 文件 MD5