簡體   English   中英

如何殺死卡在啟動的Windows服務進程?

[英]How to kill Windows service process stuck at starting?

當我嘗試啟動此類服務時,我遇到了一項服務的問題,該服務卡在啟動階段,並且我無法終止此類過程。 我知道重啟是一種解決方案,但是服務器不能每天重啟幾次,也不允許安裝和使用任何其他軟件,如 Process Explorer。

到目前為止,我嘗試使用以下解決方案(所有命令均以管理員身份執行):

taskkill /f /pid 7788
ERROR: The process with PID 7788 could not be terminated.
Reason: Access is denied.

C:\Windows\system32>wmic
wmic:root\cli>process where name="ProcesName.exe" delete
Delete '\\xxxxx\ROOT\CIMV2:Win32_Process.Handle="7788"' (Y/N/?)? y
Deleting instance \\xxxxx\ROOT\CIMV2:Win32_Process.Handle="7788"
ERROR:
Description = Access denied
wmic:root\cli>


C:\Windows\system32>wmic
wmic:root\cli>process where name="ProcesName.exe" call terminate
Execute (\\xxxxx\ROOT\CIMV2:Win32_Process.Handle="7788")->terminate() (Y/N/?)? y
Method execution successful.
Out Parameters:
instance of __PARAMETERS
{
        ReturnValue = 2;
};

wmic:root\cli>


C:\Windows\system32>taskkill /IM "ProcessName.exe" /T /F
ERROR: The process with PID 7788 (child process of PID 680) could not be terminated.
Reason: Access is denied.

C:\Windows\system32>tasklist | findstr 680
services.exe                   680 Services                   0      9 084 K
java.exe                      5832 Services                   0    443 680 K

1- 以管理員身份運行 PowerShell

2-輸入: Get-Service like this pic輸入Get-Service命令后

3- 輸入: Stop-Service -Name "SERVICE-NAME" Like this Picture

停止服務示例

停止服務后的結果

4-如果服務沒有停止嘗試這個命令

Set-Service -Name "SERVICE-NAME" -Status stopped -force

另一種解決方案:

1-以管理員身份打開powershell或CMD。

2- {{服務路徑}} -k netsvcs

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM