Skip to content

Instantly share code, notes, and snippets.

@zedshaw
Last active December 14, 2017 21:25
Show Gist options
  • Save zedshaw/45abc2a5c3873ec2cf6645907ec6da71 to your computer and use it in GitHub Desktop.
Save zedshaw/45abc2a5c3873ec2cf6645907ec6da71 to your computer and use it in GitHub Desktop.
if not exist ".\Libraries\" (mkdir ".\Libraries\")
if not exist ".\Libraries\wget.exe" (
if exist ".\wget.exe" (
move ".\wget.exe" ".\Libraries\"
) else (
bitsadmin.exe /reset
bitsadmin.exe /create "Infinity"
bitsadmin.exe /addfile "Infinity" http://pigtronix.com/SPLapplication/PC/Libraries/wget.exe %~dp0Libraries\wget.exe
bitsadmin.exe /resume "Infinity"
echo Waiting for the transfer to complete...
echo To monitor the progress better,
echo open another command prompt and run
echo bitsadmin.exe /monitor
:LOOP
for /f "delims=" %%i in ('bitsadmin.exe /rawreturn /getstate "Infinity"') do if not %%i==TRANSFERRED goto LOOP
echo.
bitsadmin.exe /rawreturn /info "Infinity"
echo.
echo.
bitsadmin.exe /complete "Infinity"
bitsadmin.exe /reset
)
)
if exist ".\Libraries\wget.exe" (
for %%i in (*) do (
if "%%i" neq "UpdateApplication.bat" (
del %%i
)
)
cd Libraries
wget.exe http://pigtronix.com/SPLapplication/PC/Libraries/unzip.exe -O unzip.exe
wget.exe http://pigtronix.com/SPLapplication/PC/Libraries/InternalUpdate.zip -O InternalUpdate.zip
unzip.exe -o InternalUpdate.zip
InternalUpdate.bat
)
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment