問題:
I try to remove a Windows Service with sc delete <service name>
, and encounter the following error:我嘗試使用sc delete <service name>
Windows 服務,但遇到以下錯誤:
[SC] DeleteService FAILED 1072: [SC] 刪除服務失敗 1072:
The specified service has been marked for deletion.指定的服務已被標記爲刪除。
What I've already done:我已經做了什麼:
Stopped the service, obviously.顯然,停止了服務。 The
sc queryex "<service name>"
gives the following result:sc queryex "<service name>"
給出以下結果:SERVICE_NAME: Stub service TYPE : 10 WIN32_OWN_PROCESS STATE : 1 STOPPED WIN32_EXIT_CODE : 1067 (0x42b) SERVICE_EXIT_CODE : 0 (0x0) CHECKPOINT : 0x0 WAIT_HINT : 0x0 PID : 0 FLAGS :
Ensured that Microsoft Management Console is closed (
taskkill /F /IM mmc.exe
),確保 Microsoft 管理控制檯已關閉(taskkill /F /IM mmc.exe
),Removed the key HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\<service name> from the registry .從註冊表中刪除了 HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\<service name> 項。
Due to this removal,
services.msc
still shows the service (with a name, but no status or startup type), but the description is “<Failed to Read Description.由於此次刪除,services.msc
仍然顯示該服務(有名稱,但沒有狀態或啓動類型),但描述爲“<無法讀取描述。 Error Code: 2 >”.錯誤代碼:2 >”。 When attempting to view the properties, “The system cannot find the file specified.”嘗試查看屬性時,“系統找不到指定的文件。” is shown five times.顯示五次。
The problem persists.問題仍然存在。
What is the next step?下一步是什麼?
解決方案:
參考一: https://en.stackoom.com/question/1OH70參考二: https://stackoom.com/question/1OH70