Skip to content

Instantly share code, notes, and snippets.

@steve-jansen
Created March 5, 2014 22:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steve-jansen/9378219 to your computer and use it in GitHub Desktop.
Save steve-jansen/9378219 to your computer and use it in GitHub Desktop.
A Windows batch script to download multiple large binary files from an FTP server in parallel, with support for resuming interrupted downloads.
SETLOCAL
PUSHD "%USERPROFILE%\Downloads"
IF NOT EXIST "installers" MKDIR "installers"
CD "installers"
ECHO @ECHO OFF > curl.cmd
ECHO TITLE "%~1" >> curl.cmd
ECHO IF NOT ".%~p1"==".\" IF NOT EXIST ".%~p1" MKDIR ".%~p1" >> curl.cmd
ECHO PUSHD ".%~p1" >> curl.cmd
ECHO "%ProgramFiles%\Git\bin\curl.exe" -C - -v -O "ftp://ftp.example.com/path/to/installers%~1" ^&^& PAUSE >> curl.cmd
START "" "%COMSPEC%" /D /C "curl.cmd ^"/dotNetFx40_Full_x86_x64.exe^""
START "" "%COMSPEC%" /D /C "curl.cmd ^"/Internet Information Services 7.5 Express/iisexpress_1_11_x86_en-US.msi^""
START "" "%COMSPEC%" /D /C "curl.cmd ^"/Internet Information Services 7.5 Express/rewrite_2.0_rtw_x86.msi^""
START "" "%COMSPEC%" /D /C "curl.cmd ^"/Microsoft SQL Server 2008 Express R2 SP1/SQLEXPRWT_x86_ENU.exe^""
START "" "%COMSPEC%" /D /C "curl.cmd ^"/Microsoft Visual Studio 2010/VS2010PREM_ENU.zip^""
START "" "%COMSPEC%" /D /C "curl.cmd ^"/Microsoft Visual Studio 2010 SP1/VS10sp1-KB983509.exe^""
START "" "%COMSPEC%" /D /C "curl.cmd ^"/Microsoft SQL Server Data Tools/SSDT_10.3.31009.2_EN.iso.zip^""
START "" "%COMSPEC%" /D /C "curl.cmd ^"/Microsoft SQL Server 2012 Tools/SQLManagementStudio_x86_ENU.exe^""
START "" "%COMSPEC%" /D /C "curl.cmd ^"/Microsoft SQL Server 2012 Tools/x86/SqlLocaLDB.MSI^""
START "" "%COMSPEC%" /D /C "curl.cmd ^"/Microsoft Web Deploy V3/WebDeploy_x86_en-US.msi^""
START "" "%COMSPEC%" /D /C "curl.cmd ^"/MSBuild Extension Pack 4.0/MSBuild Extension Pack 4.0.msi^""
DEL /Q curl.cmd
POPD
ENDLOCAL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment