TASKKILL
(task kill)
TASKKILL
[/S system [/U username [/P [password]]]]
{ [/FI filter] [/PID processid
| /IM imagename] } [/F] [/T]
描述:
这个命令行工具可用来结束至少一个进程。
可以根据进程 id 或图像名来结束进程。
参数列表:
/S system
指定要连接到的远程系统。
/U [domain\]user 指定应该在哪个用户上下文执行这个命令。
/P [password] 为提供的用户上下文指定密码。如果忽略,提示输入。
/F
指定要强行终止进程。
/FI filter
指定筛选进或筛选出查询的的任务。
/PID process id 指定要终止的进程的PID。
/IM image name 指定要终止的进程的图像名。通配符 '*'可用来指定所有图像名。
/T
Tree kill: 终止指定的进程和任何由此启动的子进程。
/?
显示帮助/用法。
筛选器:
筛选器名 有效运算符
有效值
----------- ---------------
--------------
STATUS eq, ne 运行 | 没有响应
IMAGENAME eq,
ne
图像名
PID
eq, ne, gt, lt, ge,
le PID 值
SESSION eq, ne, gt,
lt, ge, le 会话编号
CPUTIME eq, ne, gt,
lt, ge, le CPU 时间,格式为
hh:mm:ss。
hh - 时,
mm - 钟,ss - 秒
MEMUSAGE eq, ne, gt,
lt, ge, le 内存使用,单位为 KB
USERNAME eq, ne
用户名,格式为
[domain\]user
MODULES eq, ne
DLL 名
SERVICES eq, ne
服务名
WINDOWTITLE eq,
ne
窗口标题
注意: 只有带有筛选器的情况下,才能跟 /IM 切换使用通配符 '*'。
注意: 远程进程总是要强行终止,不管是否指定了 /F 选项。
例如:
TASKKILL /S system /F /IM
notepad.exe /T
TASKKILL /PID 1230 /PID 1241
/PID 1253 /T
TASKKILL /F /IM notepad.exe
/IM mspaint.exe
TASKKILL /F /FI "PID ge 1000" /FI "WINDOWTITLE ne
untitle*"
TASKKILL /F /FI
"USERNAME eq NT AUTHORITY\SYSTEM" /IM
notepad.exe
TASKKILL /S system /U
domain\username /FI "USERNAME ne NT*" /IM *
TASKKILL /S system /U
username /P password /FI "IMAGENAME eq
note*"
TASKKILL
[/S system [/U username [/P [password]]]]
{ [/FI filter] [/PID processid
| /IM imagename] } [/F] [/T]
Description:
This command line tool can
be used to end one or more processes.
Processes can be killed by
the process id or image name.
Parameter
List:
/S system
Specifies the remote system to connect to.
/U [domain\]user Specifies the user context
under which the command should execute.
/P [password] Specifies
the password for the given user context. Prompts for input if omitted.
/F
Specifies to forcefully terminate process(es).
/FI filter
Displays a set of tasks that match a given criteria specified by the
filter.
/PID process id Specifies
the PID of the process that has to be terminated.
/IM image name Specifies
the image name of the process that has to be terminated. Wildcard '*' can be
used to specify all image names.
/T
Tree kill: terminates the specified process and any child processes
which were started by it.
/?
Displays this help/usage.
Filters:
Filter Name Valid Operators
Valid Value(s)
----------- ---------------
--------------
STATUS eq, ne
RUNNING | NOT RESPONDING
IMAGENAME eq,
ne
Image name
PID
eq, ne, gt, lt, ge, le PID value
SESSION eq, ne, gt,
lt, ge,
le Session number.
CPUTIME eq, ne, gt,
lt, ge,
le CPU time in the
format
of hh:mm:ss.
hh - hours,
mm - minutes, ss - seconds
MEMUSAGE eq, ne, gt,
lt, ge,
le Memory usage in KB
USERNAME eq, ne
User name in [domain\]user
format
MODULES eq, ne
DLL
name
SERVICES eq, ne
Service name
WINDOWTITLE eq, ne
Window title
NOTE:
Wildcard '*' for the /IM switch is accepted only with filters.
NOTE:
Termination of remote processes will always be done forcefully irrespective of
whether /F option is specified or not.
Examples:
TASKKILL /S system /F /IM
notepad.exe /T
TASKKILL /PID 1230 /PID 1241
/PID 1253 /T
TASKKILL /F /IM notepad.exe
/IM mspaint.exe
TASKKILL /F /FI "PID ge 1000" /FI "WINDOWTITLE ne
untitle*"
TASKKILL /F /FI
"USERNAME eq NT AUTHORITY\SYSTEM" /IM
notepad.exe
TASKKILL /S system /U
domain\username /FI "USERNAME ne NT*" /IM *
TASKKILL /S system /U
username /P password /FI "IMAGENAME eq
note*"