有谁知道如何抑制消息“没有可用的实例”。从以下命令?提前高度感谢您的帮助!
wmic process where (name="java.exe") get commandline | findstr /i /c:"xxx" 1>nul 2>&1
有谁知道如何抑制消息“没有可用的实例”。从以下命令?提前高度感谢您的帮助!
wmic process where (name="java.exe") get commandline | findstr /i /c:"xxx" 1>nul 2>&1
您还可以通过管道将 stderr 输入到 stdout 中,使其对您的 findstr 命令可见(从而忽略“没有可用的实例。”由于您的过滤器):
wmic process where (name="java.exe") get commandline 2>&1 | findstr /i /c:"xxx"
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"