@echo off setlocal EnableExtensions set "URL=%~1" set "OUT=%~2" if not defined URL ( echo Usage: %~nx0 URL [OUTPUT] exit /b 2 ) if not defined OUT set "OUT=download.bin" where curl.exe >nul 2>nul if errorlevel 1 ( echo curl.exe not found. exit /b 1 ) echo Downloading %URL% curl.exe -fL --retry 3 --retry-delay 2 -C - -o "%OUT%" "%URL%" if errorlevel 1 ( echo Download failed. exit /b 1 ) for %%A in ("%OUT%") do echo Saved: %%~fA (%%~zA bytes) endlocal