1

I know already how I can kill all java.exe processes

taskkill /F /IM java.exe

But when it comes to a full executable path D:\Program Files\Java\jdk1.8.0_331\bin\java.exe, how do I do ?

I'm asking because I don't want to kill other processes running on another distribution of jdk than this one.

0

1 Answer 1

3

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.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .