tasklisttasklist

显示本地计算机或远程计算机上当前正在运行的进程列表。Displays a list of currently running processes on the local computer or on a remote computer. Tasklist 替换 tlist.exe 工具。Tasklist replaces the tlist tool.

备注

此命令替换 tlist.exe 工具。This command replaces the tlist tool.

语法Syntax

tasklist [/s <computer> [/u [<domain>\]<username> [/p <password>]]] [{/m <module> | /svc | /v}] [/fo {table | list | csv}] [/nh] [/fi <filter> [/fi <filter> [ ... ]]]

参数Parameters

参数Parameter 说明Description
/s <computer>/s <computer> 指定远程计算机的名称或 IP 地址, (不要使用反斜杠) 。Specifies the name or IP address of a remote computer (do not use backslashes). 默认为本地计算机。The default is the local computer.
/u <domain>\<username>/u <domain>\<username> 使用由或指定的用户的帐户权限运行该命令 <username> <domain>\<username>Runs the command with the account permissions of the user who is specified by <username> or by <domain>\<username>. 只有在同时指定了 /s参数时,才能指定 /u参数。The /u parameter can be specified only if /s is also specified. 默认值是当前登录到发出命令的计算机的用户的权限。The default is the permissions of the user who is currently logged on to the computer that is issuing the command.
/p <password>/p <password> 指定在 /u 参数中指定的用户帐户的密码。Specifies the password of the user account that is specified in the /u parameter.
一样 <module>/m <module> 列出与给定模式名称匹配的、加载了 DLL 模块的所有任务。Lists all tasks with DLL modules loaded that match the given pattern name. 如果未指定模块名称,此选项将显示每个任务加载的所有模块。If the module name is not specified, this option displays all modules loaded by each task.
svcsvc 列出每个进程的所有不截断的服务信息。Lists all the service information for each process without truncation. /fo 参数设置为 时有效。Valid when the /fo parameter is set to table.
/v/v 在输出中显示详细的任务信息。Displays verbose task information in the output. 若要在不截断的情况下完成详细的输出,请将 /v/svc 一起使用。For complete verbose output without truncation, use /v and /svc together.
/fo {table | list | csv}/fo {table | list | csv} 指定要用于输出的格式。Specifies the format to use for the output. 有效值为 tablelistcsvValid values are table, list, and csv. 输出的默认格式为 tableThe default format for output is table.
/nh/nh 取消输出中的列标题。Suppresses column headers in the output. /fo 参数设置为 csv时有效。Valid when the /fo parameter is set to table or csv.
/fi <filter>/fi <filter> 指定要包含在查询中或从查询中排除的进程的类型。Specifies the types of processes to include in or exclude from the query. 可以使用多个筛选器,也可以使用通配符 (\) 来指定所有任务或映像名称。You can use more than one filter or use the wildcard character (\) to specify all tasks or image names. 本文的 筛选器名称、运算符和值 一节中列出了有效的筛选器。The valid filters are listed in the Filter names, operators, and values section of this article.
/?/? 在命令提示符下显示帮助。Displays help at the command prompt.

筛选器名称、运算符和值Filter names, operators, and values

筛选器名称Filter Name 有效的运算符Valid Operators 有效值 (s) Valid Value(s)
状态STATUS eq、neeq, ne RUNNING | NOT RESPONDING | UNKNOWN.RUNNING | NOT RESPONDING | UNKNOWN. 如果指定远程系统,则不支持此筛选器。This filter isn't supported if you specify a remote system.
IMAGENAMEIMAGENAME eq、neeq, ne 映像名称Image name
PIDPID eq、ne、gt、lt、ge、leeq, ne, gt, lt, ge, le PID 值PID value
SESSIONSESSION eq、ne、gt、lt、ge、leeq, ne, gt, lt, ge, le 会话号Session number
SESSIONNAMESESSIONNAME eq、neeq, ne “会话名称”Session name
CPUtimeCPUtime eq、ne、gt、lt、ge、leeq, ne, gt, lt, ge, le 采用 HH: MM: SS格式的 CPU 时间,其中 MMSS 介于0到59之间, HH 是任意无符号数字CPU time in the format HH:MM:SS, where MM and SS are between 0 and 59 and HH is any unsigned number
MEMUSAGEMEMUSAGE eq、ne、gt、lt、ge、leeq, ne, gt, lt, ge, le 内存使用量(KB)Memory usage in KB
USERNAMEUSERNAME eq、neeq, ne 任何有效用户名 (<user><domain\user>) Any valid user name (<user> or <domain\user>)
服务SERVICES eq、neeq, ne 服务名称Service name
SYSTEM.WINDOWS.CONTROLS.PAGE.WINDOWTITLEWINDOWTITLE eq、neeq, ne 窗口标题。Window title. 如果指定远程系统,则不支持此筛选器。This filter isn't supported if you specify a remote system.
模块MODULES eq、neeq, ne DLL 名称DLL name

示例Examples

若要列出 进程 ID 大于 1000的所有任务并将 其显示为 csv 格式,请键入:To list all tasks with a process ID greater than 1000, and display them in csv format, type:

tasklist /v /fi "PID gt 1000" /fo csv

若要列出当前正在运行的系统进程,请键入:To list the system processes that are currently running, type:

tasklist /fi "USERNAME ne NT AUTHORITY\SYSTEM" /fi "STATUS eq running"

若要列出当前正在运行的所有进程的详细信息,请键入:To list detailed information for all processes that are currently running, type:

tasklist /v /fi "STATUS eq running"

若要列出远程计算机 srvmain上的进程的所有服务信息(其 DLL 名称 以 ntdll.dll 开头),请键入:To list all the service information for processes on the remote computer srvmain, which has a DLL name beginning with ntdll, type:

tasklist /s srvmain /svc /fi "MODULES eq ntdll*"

若要列出远程计算机 srvmain上的进程,请使用当前登录的用户帐户的凭据,键入:To list the processes on the remote computer srvmain, using the credentials of your currently logged-on user account, type:

tasklist /s srvmain

要使用用户帐户 Hiropln的凭据列出远程计算机srvmain上的进程,请键入:To list the processes on the remote computer srvmain, using the credentials of the user account Hiropln, type:

tasklist /s srvmain /u maindom\hiropln /p p@ssW23

其他参考Additional References