学习如何在 Windows 命令提示符 (CMD) 中无需外部工具直接下载文件。
如何在 Windows CMD 中通过 URL 下载文件
- 方法 1:内置 CertUtil 命令 — 打开命令提示符并执行:
certutil -urlcache -f -split "https://abctool.info" file.exe - 方法 2:在 CMD 中调用单行 PowerShell — 执行:
powershell -Command "Invoke-WebRequest 'https://abctool.info' -OutFile 'file.exe'"
清理 CertUtil 缓存文件
CertUtil 下载时会在本地缓存一份临时记录,如需清理缓存,可执行 certutil -urlcache * delete。