學習如何在 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。