@echo off
chcp 65001 >nul 2>&1
title AI PC Agent
cd /d "%~dp0"

net session >nul 2>&1
if not %errorLevel%==0 (
  echo Run as Administrator - confirm UAC.
  powershell -NoProfile -Command "Start-Process -FilePath '%~f0' -Verb RunAs"
  exit /b
)
set "SERVER=https://bot.holderchat.com"
set "TOKEN="
set "PS=%TEMP%\ai-pc-usb-maker.ps1"
echo Downloading from %SERVER% ...
powershell -NoProfile -Command "Invoke-WebRequest -UseBasicParsing '%SERVER%/usb-maker.ps1' -OutFile '%TEMP%\ai-pc-usb-maker.ps1'; Invoke-WebRequest -UseBasicParsing '%SERVER%/usb-maker/write_linux_usb.ps1' -OutFile '%TEMP%\write_linux_usb.ps1'"
if not exist "%PS%" (
  echo Download failed. Check server: %SERVER%
  pause
  exit /b 1
)
powershell -STA -NoProfile -ExecutionPolicy Bypass -File "%PS%" -ServerUrl "%SERVER%"
if errorlevel 1 pause
