Search code examples
batch-fileasp.net-corebatch-processing

Kill services by name from batch file


I have multiple processes (dotnet.exe) and i don't want to kill them all using something like:

taskkill /F /IM dotnet.exe

Those processes are, in fact, some microservices (under .net core) and i want to kill them by service name.

Obviously, you cannot do something like: taskkill /F /IM WanVet.Micro.AppointmentManagement.Read because that isn't a process.

microservices

processes

Is there a way to do this without PID?


Solution

  • taskkill /F /FI "SERVICES eq yourservice"