从Windows上的php pclose_popen(exec)获取pid

时间:2022-06-10 17:10:30

I have script
pclose(popen("D: & cd D:\server\LoginServer & start /b startLoginServer.bat", "r"));
startloginserver.bat starts java process and i need to get its pid to kill it when needed. I'm new in these things.

我有脚本pclose(popen(“D:&cd D:\ server \ LoginServer&start / b startLoginServer.bat”,“r”)); startloginserver.bat启动java进程,我需要让它的pid在需要时杀死它。我是这些东西的新手。

1 个解决方案

#1


0  

In cmd to do it there's a command tasklist .. will list the process with pid and then type taskkill /PID pid /F . Note: pid is the listed process id

在cmd中执行它有一个命令tasklist ..将使用pid列出进程,然后键入taskkill / PID pid / F.注意:pid是列出的进程ID

#1


0  

In cmd to do it there's a command tasklist .. will list the process with pid and then type taskkill /PID pid /F . Note: pid is the listed process id

在cmd中执行它有一个命令tasklist ..将使用pid列出进程,然后键入taskkill / PID pid / F.注意:pid是列出的进程ID