Skip to content

Instantly share code, notes, and snippets.

@vignesh0025-zz
Created December 8, 2018 14:49
Show Gist options
  • Save vignesh0025-zz/5afd92b4842d928bea2c8e393e085bf2 to your computer and use it in GitHub Desktop.
Save vignesh0025-zz/5afd92b4842d928bea2c8e393e085bf2 to your computer and use it in GitHub Desktop.
Windows batch script to download a file even after network failure
REM You need to install wget (Use choco to do it easily)
@echo off
setlocal EnableExtensions
:download
wget -c -t inf --waitretry=3 --timeout=10 --retry-connrefused <url>
echo ERROR is %errorlevel%
if %ERRORLEVEL% == 0 (
echo "Success"
) ELSE (
echo "Failure"
timeout 5
goto download
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment