解決:install service error: InstallAsEventCreate() failed: xxx registry key already exists



一、事故現場

在windows系統下安裝服務,cmd窗口執行如下命令:

"E:\work\_base\PsUm\PsUser\LdapWebServer\LdapWebServer.exe" install

報錯:

install service error:  InstallAsEventCreate() failed: SYSTEM\CurrentControlSet\Services\EventLog\Application\PsLdapWebServer registry key already exists

二、分析

該問題的出現的原因在於,之前在該服務上成功安裝使用過該服務,然后使用sc delete命令卸載了,但是對應的registry注冊表中對應的信息沒有清除,因此我們在當前安裝服務的過程中就會出現因為無法將服務信息寫進注冊而導致安裝服務失敗!!!

三、解決方案

刪除注冊表相應的信息;

1、打開注冊表:WIN + R 輸入 regedit.exe

打開注冊表管理器:
在這里插入圖片描述

2、從注冊表對應的路徑:“計算機\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application\PsLdapWebServer\” 找到PsLdapWebServer相關內容,刪除即可;

在這里插入圖片描述
在這里插入圖片描述

3、再次install 服務,成功!

C:\WINDOWS\system32>"E:\work\_base\PsUm\PsUser\LdapWebServer\LdapWebServer.exe" install
Service "PsLdapWebServer" installed.


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM