Files
youlegames/codes/minipro/wxserver/stop_server.bat
2026-02-04 23:47:45 +08:00

21 lines
453 B
Batchfile

@echo off
setlocal
set PORT=3000
echo Looking for process on port %PORT%...
:: 查找占用端口 3000 的进程 PID
set PID=
for /f "tokens=5" %%a in ('netstat -aon ^| findstr ":%PORT% " ^| findstr "LISTENING"') do (
set PID=%%a
)
if defined PID (
echo Found process with PID: %PID%
echo Killing process...
taskkill /F /PID %PID%
echo Server stopped successfully.
) else (
echo No server found running on port %PORT%.
)
pause