进程名称命令行 [英] command line of process by name

查看:93
本文介绍了进程名称命令行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在cmd中使用了以下命令来获取进程命令行。它提供了所有进程的详细信息:

I used the following command in cmd to get the process command line. It gives details of all processes:

WMIC /OUTPUT:C:\ProcessList.txt PROCESS get Caption,Commandline,Processid

我想在记事本中按名称获取特定进程的详细信息。谢谢

I want to get the details of a particular process by name in a note pad. Thanx.

推荐答案

您可以使用WHERE子句。但是,您不必费心说出您要寻找的进程。

You can use the WHERE clause. But you didn't bother to say what process you were looking for.

如果您知道processId,则可以使用类似的东西。

If you know the processId you could use something like.

WMIC /OUTPUT:"C:\ProcessList.txt" process where processid=8196 get Caption,Commandline,Processid

/ output选项的替代方法是简单地重定向输出。如果您知道标题,则可以使用以下类似的内容:

An alternative to the /output option is to simply redirect the output. If you know the caption, then you can use something like:

>"c:\ProcessList.txt" wmic process where "caption='chrome.exe'" get caption,commmandLine,processId

WHERE子句使用SQL语法-字符串用单引号引起来。您可以使用复杂的逻辑和通配符。 匹配任何0个或更多字符,而 _ 匹配任何一个字符。

The WHERE clause uses SQL syntax - strings are in single quotes. You can use complex logic and wild cards. The % matches any 0 or more characters, and _ matches any one character.

>"c:\ProcessList.txt" wmic process where "caption like 'c%.ex_' and processId<5000" get caption,commandLine,processId

这篇关于进程名称命令行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆