how to get PID from command line filtered by username and imagename

后端 未结 4 1387
广开言路
广开言路 2020-12-06 14:45

I need to be able to get the PID from a running process (cmd.exe) using the command line. The problem is there are two cmd.exe running. One is under the username SYSTEM and

4条回答
  •  情书的邮戳
    2020-12-06 15:07

    This will display all processes named "cmd.exe" for the user "compUser":

    tasklist /FI "IMAGENAME eq cmd.exe" /FI "USERNAME eq compUser"
    

提交回复
热议问题