Skip to content

Instantly share code, notes, and snippets.

@174n
Last active June 4, 2019 15:37
Show Gist options
  • Save 174n/cc94d2edeab21ecb5d0b78fec4aa67e7 to your computer and use it in GitHub Desktop.
Save 174n/cc94d2edeab21ecb5d0b78fec4aa67e7 to your computer and use it in GitHub Desktop.
download aria2c bat file
@echo off
if not exist "%~dp0aria2c.exe" (
echo Downloading aria2c.exe...
powershell -Command "(New-Object Net.WebClient).DownloadFile('https://uupdump.ml/autodl_files/aria2c.exe', '%~dp0aria2c.exe')"
)
call :checkhash "3eb8712b0db6ba466f8afe1bf606983fe8341c941bdfcadc07068288c7ca5a9c" "aria2c.exe"
goto start
:checkhash
for /F "skip=1" %%i in ('certutil -hashfile %~2 SHA256') do set CURRHASH=%%i & goto HaveValue
:HaveValue
set CURRHASH=%CURRHASH: =%
if not "%~1" == "%CURRHASH%" (
del %~2
echo "%~2 hash does not match"
goto halt
)
goto :EOF
:halt
call :haltHelper 2> nul
:haltHelper
()
exit /b
:start
echo "hi there"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment