taskkill to differentiate 2 images by path
问题 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 two different locations C:\Dir1 and C:\Dir2 Does tasklist has any switch to get the path name 回答1: taskkill cannot do it. But you could use PowerShell if it's an option: (Get-WmiObject Win32_Process | Where-Object { $_.Path.StartsWith('C:\Dir1') }).Terminate() 回答2: Based on Joey's answer: wmic Path win32_process Where "CommandLine Like '%