If you ever has trouble with a service being stuck in a ' starting ' or ' stopping ' state, you can run a couple of simple co Mmands to kill the service.
| 1. |
query the process to kill the Service know its PID or Process ID. To find this just type the following with at a command prompt: sc queryex servicename <enter> Rep Lace ' ServiceName ' with the Services registry name. For Example:print Spooler is Spooler. C:\users\yemen_000>sc queryex mssql$sqlexpress service_name:mssql$sqlexpress Type:10 WIN32_OWN _process State:4 RUNNING (stoppable, pausable, Accepts_shutdown) win32_exit_code:0 (0x0) Service_exit_ code:0 (0x0) checkpoint:0x0 wait_hint:0x0 pid:2184 FLAGS: |
&NBSP; |
| 2. |
Identify the PID After running the query, you'll by presented with a list of details. You'll want to locate the PID. |
|
| 3. |
Run the Taskkill command Now so you had the PID, you can run the following command to kill the hung process: taskkill/f/pid [PID] <Enter> This would force kill the hung service. |