61 lines
1.5 KiB
Batchfile
61 lines
1.5 KiB
Batchfile
@echo off
|
|
REM GSP Windows Agent - Uninstall Task Scheduler Entry
|
|
REM This script removes the scheduled task only (does NOT delete C:\GSP\home or any game servers)
|
|
|
|
setlocal enabledelayedexpansion
|
|
|
|
REM Check for Administrator privileges
|
|
net session >nul 2>&1
|
|
if %errorlevel% neq 0 (
|
|
echo.
|
|
echo ERROR: This uninstaller 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
|
|
)
|
|
|
|
echo.
|
|
echo GSP Windows Agent - Remove Scheduled Task
|
|
echo.
|
|
echo WARNING: This will only remove the Task Scheduler entry.
|
|
echo It will NOT delete C:\GSP\home or any game servers.
|
|
echo It will NOT delete the agent installation.
|
|
echo.
|
|
|
|
set /p CONFIRM="Are you sure? (Y/N): "
|
|
|
|
if /i "%CONFIRM%"=="Y" (
|
|
echo.
|
|
echo Stopping scheduled task...
|
|
taskkill /FI "TASKNAME eq GSP Windows Agent" /F 2>nul
|
|
|
|
echo Removing scheduled task...
|
|
schtasks /delete /tn "GSP Windows Agent" /f
|
|
|
|
if %errorlevel% equ 0 (
|
|
echo.
|
|
echo SUCCESS: Scheduled task removed.
|
|
echo.
|
|
echo Agent installation remains at C:\GSP
|
|
echo Game servers remain at C:\GSP\home
|
|
echo Backups remain at C:\GSP\backups
|
|
echo.
|
|
echo To manually start the agent, run:
|
|
echo C:\GSP\Agent\OGP64\agent_start.bat
|
|
echo.
|
|
) else (
|
|
echo.
|
|
echo ERROR: Failed to remove scheduled task.
|
|
echo.
|
|
)
|
|
) else (
|
|
echo Uninstall cancelled.
|
|
)
|
|
|
|
echo.
|
|
pause
|