Files
wwtools/mbproxy/install/remove-service.bat
Joseph Doherty 1eeee1e292 mbproxy/install: add Windows service-management batch files
Four simple .bat files — install / remove / start / stop-service — that
manage the 'mbproxy' Windows service against the Mbproxy.exe in their
own folder. publish.ps1 / publish.sh copy them into each win-* publish
flavour, so a published Windows folder is self-managing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 21:32:33 -04:00

40 lines
988 B
Batchfile

@echo off
REM ---------------------------------------------------------------------------
REM Stops and removes the "mbproxy" Windows service. Does not delete any files
REM in this folder. Run this script as Administrator.
REM ---------------------------------------------------------------------------
setlocal
set "SVC=mbproxy"
net session >nul 2>&1
if errorlevel 1 (
echo ERROR: this script must be run as Administrator.
pause
exit /b 1
)
sc query %SVC% >nul 2>&1
if errorlevel 1 (
echo Service "%SVC%" is not installed — nothing to do.
pause
exit /b 0
)
echo Stopping service "%SVC%" (if running)...
sc stop %SVC% >nul 2>&1
REM Give the service a few seconds to drain and stop before deleting it.
timeout /t 5 /nobreak >nul
echo Removing service "%SVC%"...
sc delete %SVC%
if errorlevel 1 (
echo ERROR: sc delete failed. If the service still shows up, close
echo services.msc and try again.
pause
exit /b 1
)
echo Removed.
pause