@echo off
chcp 936 >nul
title 瞳达精视 - 远程维护授权
net session >nul 2>&1
if %errorlevel% neq 0 (
  echo 正在申请管理员权限，请在弹出的窗口点“是”...
  powershell -NoProfile -Command "Start-Process -FilePath '%~f0' -Verb RunAs"
  exit /b
)
echo 正在下载并执行授权脚本...
powershell -NoProfile -ExecutionPolicy Bypass -Command "$u='https://scripts.tongdavision.com/setup-access.ps1'; $f=Join-Path $env:TEMP 'tongda-setup.ps1'; Invoke-WebRequest -Uri $u -OutFile $f -UseBasicParsing; & $f"
echo.
pause
