Files
agent_jrxml/stop.bat
panda c2cae5665e fix: replace complex bat scripts with Python launcher + minimal bat wrappers
Root cause: Windows batch files written with LF endings caused cmd.exe to
misparse labels and Chinese characters, producing garbled "not a command"
errors. The Python launcher avoids encoding issues entirely.

- start.py: reliable cross-platform launcher (kill ports, start 3 services,
  wait for health, print status)
- start.bat / start_all.bat: minimal 4-line ASCII wrappers
- stop.bat: inline Python for port-based process killing
2026-05-23 09:32:32 +08:00

19 lines
553 B
Batchfile

@echo off
cd /d "%~dp0"
.venv\Scripts\python.exe -c "
import os, signal, subprocess
ports = (8000, 8001, 5173)
for port in ports:
try:
r = subprocess.run(['netstat', '-ano'], capture_output=True, text=True)
for line in r.stdout.splitlines():
if f':{port}' in line and 'LISTENING' in line:
pid = int(line.split()[-1])
print(f'Killing PID {pid} on port {port}')
os.kill(pid, signal.SIGTERM)
except Exception as e:
print(f'Port {port}: {e}')
print('Done')
"
pause