@echo off setlocal EnableExtensions cd /d "%~dp0" REM Double-click: follow remote agent 8910 logs. Ctrl+C to stop. REM Colleague setup: see Watch-Agent8910.colleague.txt (Chinese guide also available). REM Pass-through args, e.g. Watch-Agent8910.bat -Once where powershell.exe >nul 2>&1 if errorlevel 1 ( echo ERROR: powershell.exe not found. goto :end ) if not exist "%~dp0Watch-Agent8910.ps1" ( echo ERROR: Watch-Agent8910.ps1 missing next to this bat. goto :end ) echo Starting Watch-Agent8910 ... echo Local logs: repo\logs\YYYYMMDD_info.log and _error.log echo. powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -File "%~dp0Watch-Agent8910.ps1" %* set ERR=%ERRORLEVEL% echo. echo Finished. ExitCode=%ERR% :end echo. pause exit /b %ERR%