刘光辉
8 小时以前 a6f949970c9c3dec5819d01d3461130d5d9a7f08
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
@echo off
setlocal EnableExtensions
cd /d "%~dp0"
 
set "PORT=31000"
set "FOUND=0"
 
rem Find the PID listening on FlowApi's configured port.
for /f "tokens=5" %%P in ('netstat -ano -p tcp ^| findstr ":%PORT%" ^| findstr "LISTENING"') do (
    set "FOUND=1"
    echo Stopping FlowApi process %%P...
    taskkill /PID %%P /T /F >nul 2>&1
)
 
if "%FOUND%"=="0" (
    echo No process is listening on port %PORT%. FlowApi is not running.
) else (
    echo FlowApi stop command completed.
)
 
endlocal