标签:exe 进程 off for ima klist task gen 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
标签:exe 进程 off for ima klist task gen target
原文地址:https://www.cnblogs.com/xzf-o-/p/11319587.html