Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kill a windows service using its Service Name

I am looking for a way to kill a windows services using its service name rather than the process name, or PID. The two obvious choices are pskill or taskkill, but I cannot seem to find a way of using either of these methods to kill the service by name.

Is it possible to do it by the service name? If so, is anyone able to provide a quick example?

like image 928
ricky89 Avatar asked Dec 09 '14 09:12

ricky89


People also ask

How do I stop a service using sc command?

sc stop <service name> to stop the service.


1 Answers

You can use taskkill to filter by service name and kill the service you're looking for.

taskkill /F /FI "SERVICES eq yourservice"
like image 117
SomethingDark Avatar answered Sep 23 '22 15:09

SomethingDark