Find PID for Service

Published on: Weds, 12 Sept 2012



If one of the services hanged and could not be stopped and you decided to kill the executable from the task manager, but there were more than one executable with the same name, so what are you going to kill?

This is very difficult choice when you are working in a production server, so that if you killed the wrong executable, you will make troubles more than you already have.

So, how do you find the PID for the service you are going to kill, so you can kill the required executable?

The answer is rather simple; just use this command line "tasklist" as in this example:

Let assume we are going to kill the "Computer Browser" service, its using the svchost.exe like the rest of windows services, so which svchost.exe we are going to kill?!

Simple run this command line: tasklist /FI "services eq Browser" (Replace Browser with the desired service name)

Find PID for Service

After that you can use the task manager, or the taskkill command line to kill the executable.