用 tasklist 查找正在运行的进程及其 PID
用 tasklist 配合 findstr 或 /FI 过滤器,快速确认某程序是否在运行并拿到它的进程 ID。
运行 `tasklist | findstr /i chrome` 查看所有匹配进程和 PID,或用 `tasklist /FI "IMAGENAME eq chrome.exe"` 直接按名称过滤。
01命令
命令
$ tasklist | findstr /i chrome :: or filtered directly: tasklist /FI "IMAGENAME eq chrome.exe"02作用说明
tasklist 会列出所有正在运行的进程,包括映像名、PID、会话名和内存占用。通过管道交给 findstr 可以从冗长列表中快速筛选,而 /FI 参数则一条命令就能按进程名过滤。拿到 PID 后即可用于 taskkill、Stop-Process 等命令。
03风险
!注意: 映像名是可执行文件名(如 chrome.exe),不是窗口标题;同一程序可能同时运行多个进程,PID 各不相同。
04撤销
✓无需撤销——该命令不会改变持久状态。
05来源
- tasklist依据: Syntax shows the /fi <filter> parameter (repeatable) for filtering tasks, e.g. by IMAGENAME, and that output includes the PID column.
- TaskList — List processes running on the machine依据: Documents the /FI filter option with the 'IMAGENAME eq name' filter string and shows the PID column in the default table output.
最后验证: 2026-09-19 · 分类: 系统与设置