REM 此方法默认搜索nginx 要修改默认请改? set "target=?"
@echo off
set/p "target=进程名(默认nginx): "
if not defined target (
set "target=nginx"
)
set "list=tasklist /fi "imagename eq %target%.exe""
%list%
set/p "yn=是否继续Y/N(默认Y): "
set "Yy=Y y"
if not defined yn (
set "yn=Y"
)
for %%a in (%Yy%) DO (
if "%%a"=="%yn%" (
for /f "tokens=2 " %%y in ('%list% /nh') do (
REM echo %%y
taskkill /F /PID %%y
)
)
)
set target=
set yn=
set Yy=
set list=
pause
链接:https://pan.baidu.com/s/11_A14SVazvIvoHssaXqjUg
提取码:y0q3
复制这段内容后打开百度网盘手机App,操作更方便哦