用 certutil -hashfile 校验文件哈希
Windows 内置命令,可计算任意文件的 MD5、SHA1 或 SHA-256 哈希。
运行 `certutil -hashfile "file.iso" SHA256`,将输出与官方公布的校验值比对。
01命令
命令
$ certutil -hashfile "C:\Downloads\file.iso" SHA25602作用说明
certutil -hashfile 从 Windows 7 起就随系统附带,无需安装,但它能算哈希这一点经常被忘记。支持的算法包括 MD5、SHA1、SHA256 和 SHA512,大多数软件页面公布的是 SHA256。命令会分多行以十六进制输出哈希,脚本中常用 `| findstr /v :` 过滤掉首尾说明行。
03风险
04撤销
✓无需撤销——该命令不会改变持久状态。
05来源
- certutil - Windows Commands依据: Documents certutil -hashfile, which computes a cryptographic hash of a file using an algorithm such as SHA256.
- CertUtil - Certificate Utility依据: Shows certutil -hashfile usage with MD5, SHA1, SHA256 and SHA512 algorithm arguments.
最后验证: 2026-09-17 · 分类: 文件与文件夹