Stop a hung service 关闭一个无响应的windows 服务
If you ever have trouble with a service being stuck in a 'starting' or 'stopping' state, you can run a couple of simple commands to kill the service.
1. |
Query the processTo kill the service you have to know its PID or Process ID. To find this just type the following in at a command prompt: sc queryex servicename Replace 'servicename' with the services registry name. For example: Print Spooler is spooler.
SERVICE_NAME: MSSQL$SQLEXPRESS |
|
---|---|---|
2. |
Identify the PIDAfter running the query you will by presented with a list of details. You will want to locate the PID. |
|
3. |
Run the Taskkill commandNow that you have the PID, you can run the following command to kill the hung process: taskkill /f /pid [PID] This will force kill the hung service. |
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步