前提条件为QQ必须是通过命令行来登陆.
@echo off
Setlocal Enabledelayedexpansion
:agn
set n=0&set "in="
::请根据实际情况对下面这句的"tokens="后面的内容作适当更改
for /f "tokens=6,11 delims=: " %%a in ('wmic process where "name='qq.exe'" get commandline^,handle') do (
set /a n+=1
set pid!n!=%%b
echo.!n! %%a
)
echo.&set input=&set /p input=请输入要退出的QQ的序号(回车退出):
if not defined input goto :eof
:again
set "in= %input:~,1%%in%"
if not "%input:~1%"=="" (
set input=%input:~1%
goto :again
)
for %%a in (%in%) do (
taskkill /f /pid !pid%%a!
)
echo.&goto :agn