rem 查找18888对应的进程记录,并输出到pid.txt文件
netstat -ano|findstr 18888>pid.txt
rem 查找进程记录,提取第5列的值,并终止进程,for 默认会已空格,制表符,;等进行字符串分割
for /f "tokens=5" %%i in (%root%\pid.txt) do (
taskkill /pid %%i /F
goto :end
)
:end
echo success!
netstat -ano|findstr 18888>pid.txt
rem 查找进程记录,提取第5列的值,并终止进程,for 默认会已空格,制表符,;等进行字符串分割
for /f "tokens=5" %%i in (%root%\pid.txt) do (
taskkill /pid %%i /F
goto :end
)
:end
echo success!
exit /B