NUL 2>&1 && goto :START_PROCESS set command="""%~f0""" 49127c4b-02dc-482e-ac4f-ec4d659b7547 SETLOCAL ENABLEDELAYEDEXPANSION set "command=!command:'=''!" powershell -NoProfile Start-Process -FilePath '%COMSPEC%' ^ -ArgumentList '/c """!command!"""' -Verb RunAs 2>NUL IF %ERRORLEVEL% GTR 0 ( echo ===================================================== echo This script needs to be executed as an administrator. echo ===================================================== echo. pause ) SETLOCAL DISABLEDELAYEDEXPANSION goto :EOF :START_PROCESS title {$archiveName} download set "aria2=files\\aria2c.exe" set "a7z=files\\7zr.exe" set "uupConv=files\\uup-converter-wimlib.7z" set "aria2Script=files\\aria2_script.%random%.txt" set "destDir=UUPs" powershell -NoProfile -ExecutionPolicy Unrestricted .\\files\\get_aria2.ps1 || (pause & exit /b 1) echo. echo Downloading the UUP converter... "%aria2%" --no-conf --async-dns=false --console-log-level=warn --log-level=info --log="aria2_download.log" -x16 -s16 -j2 -c -R -d"files" -i"files\\converter_windows" if %ERRORLEVEL% GTR 0 call :DOWNLOAD_CONVERTER_ERROR & exit /b 1 echo. if NOT EXIST ConvertConfig.ini goto :NO_FILE_ERROR if NOT EXIST CustomAppsList.txt goto :NO_FILE_ERROR if NOT EXIST %a7z% goto :NO_FILE_ERROR if NOT EXIST %uupConv% goto :NO_FILE_ERROR echo Extracting UUP converter... "%a7z%" -x!ConvertConfig.ini -x!CustomAppsList.txt -y x "%uupConv%" >NUL echo. $downloadapp :DOWNLOAD_UUPS echo Retrieving aria2 script for the UUP set... "%aria2%" --no-conf --async-dns=false --console-log-level=warn --log-level=info --log="aria2_download.log" -o"%aria2Script%" --allow-overwrite=true --auto-file-renaming=false "$url" if %ERRORLEVEL% GTR 0 call :DOWNLOAD_ERROR & exit /b 1 echo. for /F "tokens=2 delims=:" %%i in ('findstr #UUPDUMP_ERROR: "%aria2Script%"') do set DETECTED_ERROR=%%i if NOT [%DETECTED_ERROR%] == [] ( echo Unable to retrieve data from Windows Update servers. Reason: %DETECTED_ERROR% echo If this problem persists, most likely the set you are attempting to download was removed from Windows Update servers. echo. pause goto :EOF ) echo Downloading the UUP set... "%aria2%" --no-conf --async-dns=false --console-log-level=warn --log-level=info --log="aria2_download.log" -x16 -s16 -j5 -c -R -d"%destDir%" -i"%aria2Script%" if %ERRORLEVEL% GTR 0 goto :DOWNLOAD_UUPS & exit /b 1 if EXIST convert-UUP.cmd goto :START_CONVERT pause goto :EOF :START_CONVERT call convert-UUP.cmd goto :EOF :NO_FILE_ERROR echo We couldn't find one of needed files for this script. pause goto :EOF :DOWNLOAD_CONVERTER_ERROR echo. echo An error has occurred while downloading the UUP converter. pause goto :EOF :DOWNLOAD_ERROR echo. echo We have encountered an error while downloading files. pause goto :EOF :EOF SCRIPT; $shellScript = <<