Created
December 8, 2018 14:49
-
-
Save vignesh0025-zz/5afd92b4842d928bea2c8e393e085bf2 to your computer and use it in GitHub Desktop.
Windows batch script to download a file even after network failure
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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