@echo off REM _admin-shell.bat - opens an elevated cmd in steps\. REM Run this once, enter Admin password, then call any step .bat REM from inside the elevated window without further UAC prompts. fltmc >nul 2>&1 if %errorLevel% neq 0 ( powershell -NoProfile -Command "Start-Process -FilePath '%~f0' -Verb RunAs" exit /b ) cd /d "%~dp0" echo ============================================================ echo Admin shell opened at: %~dp0 whoami /groups | findstr /i "S-1-5-32-544 BUILTIN\Administrators" >nul && echo [OK] elevated as Administrator || echo [WARN] NOT elevated echo ============================================================ echo Run any step .bat without further UAC prompts, e.g.: echo 01-firewall-ssh-22.bat echo 02-rdp-enable-3389.bat echo ... echo RUN-ALL.bat runs all 17 steps in order echo exit close this window echo ============================================================ echo. cmd /K