7 lines
472 B
Batchfile
7 lines
472 B
Batchfile
@echo off
|
|
rem Silent engine stop on app exit (no pause window); same logic as stop-engine.cmd
|
|
setlocal
|
|
set "PORT=18789"
|
|
if exist "%USERPROFILE%\.zcode\chengtao\port.txt" set /p PORT=<"%USERPROFILE%\.zcode\chengtao\port.txt"
|
|
powershell -NoProfile -Command "Get-NetTCPConnection -LocalPort %PORT% -State Listen -ErrorAction SilentlyContinue | Select-Object -ExpandProperty OwningProcess -Unique | ForEach-Object { Stop-Process -Id $_ -Force -ErrorAction SilentlyContinue }"
|