有没有人知道如何抑制msg“No Instance(s)Available”。从以下命令?我们提前非常感谢您的帮助!
wmic process where (name="java.exe") get commandline | findstr /i /c:"xxx" 1>nul 2>&1
答案 0 :(得分:0)
您有两个选择放置2>nul
,
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"
答案 1 :(得分:0)
您还可以将stderr传递给stdout,使其对您的findstr命令可见(因此,由于您的过滤器而忽略“No Instance(s)Available。”):
wmic process where (name="java.exe") get commandline 2>&1 | findstr /i /c:"xxx"