taskkill
doesn't have such an option if you check its filters with taskkill /?
For pure cmd, there's wmic
that you can use:
wmic process where ExecutablePath="D:\\Program Files\\Java\\jdk1.8.0_331\\bin\\java.exe" call terminate
Also a PowerShell solution:
Get-Process | ? { $_.Path -eq "D:\Program Files\Java\jdk1.8.0_331\bin\java.exe" } | Stop-Process
?
is Where-Object
shorthand, where you check for full path.