有人知道如何从以下命令中抑制消息“没有可用的实例。”吗?非常感谢您的帮助!
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
你有两个选择可以放置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"
你也可以将 stderr 导入 stdout,使其对 findstr 命令可见(从而忽略由于过滤器而导致的“无可用实例”):
wmic process where (name="java.exe") get commandline 2>&1 | findstr /i /c:"xxx"