@echo off REM GSP Windows Agent Update Script REM This script updates an existing Git-managed agent installation setlocal enabledelayedexpansion REM Check for Administrator privileges net session >nul 2>&1 if %errorlevel% neq 0 ( echo. echo ERROR: This updater must be run as Administrator. echo. echo Please: echo 1. Right-click this batch file echo 2. Select "Run as Administrator" echo 3. Click "Yes" when prompted echo. pause exit /b 1 ) REM Get the directory where this batch file is located set "SCRIPT_DIR=%~dp0" REM Verify the PowerShell script exists if not exist "%SCRIPT_DIR%Update-GSP-WindowsAgent.ps1" ( echo ERROR: Update-GSP-WindowsAgent.ps1 not found in %SCRIPT_DIR% pause exit /b 1 ) REM Launch the PowerShell updater powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "& '%SCRIPT_DIR%Update-GSP-WindowsAgent.ps1'" %* REM Exit with PowerShell's exit code exit /b %ERRORLEVEL%