2

有谁知道如何抑制消息“没有可用的实例”。从以下命令?提前高度感谢您的帮助!

wmic process where (name="java.exe") get commandline | findstr /i /c:"xxx" 1>nul 2>&1
4

2 回答 2

0

您还可以通过管道将 stderr 输入到 stdout 中,使其对您的 findstr 命令可见(从而忽略“没有可用的实例。”由于您的过滤器):

wmic process where (name="java.exe") get commandline 2>&1 | findstr /i /c:"xxx"
于 2013-08-26T11:19:13.203 回答
0

2>nul您有2 个选择

2>nul wmic process where (name="java.exe") get commandline | findstr /i /c:"xxx"

或者你可以做

wmic process where (name="java.exe") get commandline 2>nul | findstr /i /c:"xxx"
于 2011-07-21T19:00:37.833 回答