启动 start.cmd
@echo off
start "title" start_for_window.bat
通过窗口标题查找PID 关闭(失败)
for /f "tokens=2 " %%a in ('tasklist /fi "WINDOWTITLE eq title" /nh') do TASKKILL /F /FI "PID eq %%a"
通过查找start_register.php,start_businessworker.php 的端口 (失败:businessworker自动重启)
for /f "tokens=5" %%i in ('netstat -aon ^| findstr ":88"') do (
set n=%%i
)
for /f "tokens=5" %%i in ('netstat -aon ^| findstr ":1238"') do (
set n=%%i
)
直接kill php.exe PID (成功:但是所有的php进程都kill掉了)
for /f "tokens=2 " %%a in ('tasklist /fi "IMAGENAME eq php.exe" /nh') do TASKKILL /F /FI "PID eq %%a"
求解?? 只关闭star_for_window.php 脚本
对windows不熟,帮不上忙
T_T , 好的,谢谢walker的回复