解决: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.

posted @ 2019-12-06 22:27  willingtolove  阅读(938)  评论(0编辑  收藏  举报