@echo off rem ================================================================== rem Shows whether the portal is running and on which port. rem Port is read from .env (PORT=...), default 5000. rem ================================================================== set "PORT=5000" if exist "%~dp0..\.env" ( for /f "tokens=2 delims==" %%P in ('findstr /b /i "PORT=" "%~dp0..\.env"') do set "PORT=%%P" ) set "PORT=%PORT: =%" echo === SAP-ERP Portal status (port %PORT%) === echo. powershell -NoProfile -Command "$p = Get-CimInstance Win32_Process | Where-Object { $_.Name -eq 'node.exe' -and $_.CommandLine -match 'server\.js' }; if ($p) { $p | ForEach-Object { Write-Host ('RUNNING - node.exe PID ' + $_.ProcessId) } } else { Write-Host 'NOT RUNNING' }" echo. echo Listening on port %PORT%: netstat -ano | findstr :%PORT% | findstr LISTENING if %ERRORLEVEL% NEQ 0 echo (nothing listening on %PORT%) echo. echo Autostart task: schtasks /Query /TN "SAP-ERP-Portal" 2>nul | findstr /I "SAP-ERP-Portal Ready Running" if %ERRORLEVEL% NEQ 0 echo (autostart task not installed - run install-autostart.bat) echo. pause