@echo off
setlocal EnableExtensions
set "URL=https://help.brozdo.pl/bootstrap/windows.cmd"
set "OUT=%TEMP%\RustDesk-Configure-%RANDOM%%RANDOM%.cmd"
echo Downloading latest RustDesk configuration...
powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "Invoke-WebRequest -UseBasicParsing -Uri '%URL%' -OutFile '%OUT%'"
if not "%errorlevel%"=="0" (
  echo [ERROR] Could not download the latest configuration.
  pause
  exit /b 1
)
call "%OUT%"
set "RC=%errorlevel%"
del /q "%OUT%" >nul 2>&1
exit /b %RC%
