taskkill to differentiate 2 images by path

前端 未结 5 1918
再見小時候
再見小時候 2021-01-04 01:30

How to kill a process by name and orginiated from a particular path using taskkill?

taskkill /F /IM

certainly it cant differentiate 2 process started from t

5条回答
  •  鱼传尺愫
    2021-01-04 02:18

    Based on Joey's answer:

    wmic Path win32_process Where "CommandLine Like '%-jar selenium-server.jar%'" Call Terminate
    

    This way I avoid NullReferenceException when Path is null (don't know why) and does not need PowerShell.

    Ref: https://superuser.com/questions/52159/kill-a-process-with-a-specific-command-line-from-command-line

提交回复
热议问题