You can use the WHERE clause. But you did not bother to say what process you were looking for.
If you know processId, you can use something like.
WMIC /OUTPUT:"C:\ProcessList.txt" process where processid=8196 get Caption,Commandline,Processid
An alternative to the / output option is to simply redirect the output. If you know the title, you can use something like:
>"c:\ProcessList.txt" wmic process where "caption='chrome.exe'" get caption,commmandLine,processId
The WHERE clause uses SQL syntax — strings are enclosed in single quotes. You can use complex logic and wild cards. % matches any 0 or more characters, and _ matches any character.
>"c:\ProcessList.txt" wmic process where "caption like 'c%.ex_' and processId<5000" get caption,commandLine,processId
dbenham
source share