29 lines
580 B
Batchfile
29 lines
580 B
Batchfile
@echo off
|
|
setlocal EnableExtensions
|
|
cd /d "%~dp0"
|
|
|
|
REM Double-click: fetch recent remote agent 8910 logs once, then pause.
|
|
|
|
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 -Once ...
|
|
echo.
|
|
powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -File "%~dp0Watch-Agent8910.ps1" -Once %*
|
|
set ERR=%ERRORLEVEL%
|
|
echo.
|
|
echo Finished. ExitCode=%ERR%
|
|
|
|
:end
|
|
echo.
|
|
pause
|
|
exit /b %ERR%
|