@echo off REM GSP Windows Agent Rollback Script REM This script restores a previous agent version from backup setlocal enabledelayedexpansion REM Check for Administrator privileges net session >nul 2>&1 if %errorlevel% neq 0 ( echo. echo ERROR: This rollback script 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%Rollback-GSP-WindowsAgent.ps1" ( echo ERROR: Rollback-GSP-WindowsAgent.ps1 not found in %SCRIPT_DIR% pause exit /b 1 ) REM Launch the PowerShell rollback script powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "& '%SCRIPT_DIR%Rollback-GSP-WindowsAgent.ps1'" %* REM Exit with PowerShell's exit code exit /b %ERRORLEVEL%