Post

Windows常用批处理脚本

批量停止进程

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
:: ------------------------------------------------------------------------------
:: Author : Juzi
:: Date : 2021/02/24
:: Description: 批量停止进程
:: ------------------------------------------------------------------------------

@echo off

:: 进程名(不包含.exe)
set process=Dante

set list=tasklist /fi "imagename eq %process%.exe" /nh
for /f "tokens=2" %%i in ('%list%') do (
    ::echo %%i
    taskkill /F /PID %%i
)

pause
This post is licensed under CC BY 4.0 by the author.