在 Windows 中如何在 Windows 7 的命令提示符中获取所有进程及其子进程信息
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12615665/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
In windows How get all process and their child process information in command prompt in windows 7
提问by user1699309
In windows Tasklist is the command but how list the Running process and their child process in windows 7
在 Windows 任务列表中是命令,但如何在 Windows 7 中列出正在运行的进程及其子进程
回答by arx
You can get a list of processes with the PID and parent PID using:
您可以使用以下方法获取带有 PID 和父 PID 的进程列表:
wmic process get Caption,ParentProcessId,ProcessId
wmic process get Caption,ParentProcessId,ProcessId
Given a parent PID you can list the immediatechildren with something like:
给定父 PID,您可以使用以下内容列出直接子代:
wmic process where (ParentProcessId=2480) get Caption,ProcessId
wmic process where (ParentProcessId=2480) get Caption,ProcessId