@echo off REM =================================================================== REM Park the BattleTech relay on this machine and keep it alive. REM REM Double-click to run it now, or put a SHORTCUT to this file in the REM Startup folder (Win+R -> shell:startup) so the relay comes back by REM itself after a reboot. No admin rights needed either way. REM REM The window stays open: it is the supervisor. Closing it (or Ctrl-C) REM stops the relay for good. REM REM WHY THIS HUNTS FOR AN INTERPRETER INSTEAD OF JUST SAYING "python" REM (2026-07-26): on the operator's machine `python` resolves through REM pyenv SHIMS that need PYENV/PYENV_HOME/PYENV_ROOT -- and those are REM USER-scoped to the operator's own account. A second account (e.g. a REM dedicated remote-admin login over SSH/RDP) gets NO working python at REM all: the one machine-wide PATH entry points at a Python39-32 folder REM that no longer exists. Parking the relay would then fail with REM "python is not recognized" -- from the road, at night, with players REM waiting. So: resolve a real interpreter explicitly, and say which. REM =================================================================== setlocal title BattleTech relay (parked) cd /d "%~dp0.." set "BTPY=" REM 1. explicit override always wins if defined BT_PYTHON if exist "%BT_PYTHON%" set "BTPY=%BT_PYTHON%" REM 2. the interpreter this project is developed against (has PySide6). REM Check the CALLING account's profile first, then the operator's -- REM a second admin account can read it (Administrators has access). if not defined BTPY if exist "%USERPROFILE%\.pyenv\pyenv-win\versions\3.11.4\python.exe" set "BTPY=%USERPROFILE%\.pyenv\pyenv-win\versions\3.11.4\python.exe" if not defined BTPY if exist "C:\Users\epilectrik\.pyenv\pyenv-win\versions\3.11.4\python.exe" set "BTPY=C:\Users\epilectrik\.pyenv\pyenv-win\versions\3.11.4\python.exe" REM 3. the machine-wide launcher (works for ANY account) if not defined BTPY ( if exist "C:\Windows\py.exe" set "BTPY=C:\Windows\py.exe -3" ) REM 4. whatever is on PATH, if anything if not defined BTPY ( for /f "delims=" %%P in ('where python 2^>nul') do ( if not defined BTPY set "BTPY=%%P" ) ) if not defined BTPY ( echo. echo ERROR: no Python interpreter found. echo. echo Set BT_PYTHON to a python.exe and run this again, e.g.: echo set "BT_PYTHON=C:\Users\epilectrik\.pyenv\pyenv-win\versions\3.11.4\python.exe" echo. pause exit /b 1 ) echo Using interpreter: %BTPY% %BTPY% "tools\btrelay_park.py" %* echo. echo The parked relay has stopped. pause