@echo off setlocal cd /d "%~dp0" net session >nul 2>&1 if %errorLevel% neq 0 ( echo Requesting Administrator... powershell -NoProfile -Command "Start-Process -FilePath '%~f0' -Verb RunAs" exit /b ) if exist "dist\mysql-tunnel.exe" ( dist\mysql-tunnel.exe --uninstall ) else ( echo dist\mysql-tunnel.exe not found; trying sc.exe sc stop mysql-tunnel sc delete mysql-tunnel ) pause endlocal