【发布时间】:2022-01-17 14:42:54
【问题描述】:
我正在尝试使用下面这个批处理文件安装 WCF 服务,该服务安装成功,但运行时抛出错误 1053
我试过了, - 在注册表编辑器中添加 ServicePipeTimeout DWord, - 使用 sfc /scannow 命令检查系统文件损坏, -重置网络缓存和配置, - 获得应用程序的所有权, - 使用发布版本而不是调试。
以上解决方案均未解决该错误
这是我在批处理文件中使用的代码
ECHO USAGE:
ECHO %0 [option]
ECHO r (or R) to have services installed from "Release" path. Release will also be added to service names. It will install services from debug path if nothing is specified.
ECHO.
ECHO.
SET Mode=Debug
IF "%1"=="R" (SET Mode=Release)
IF "%1"=="r" (SET Mode=Release)
SET serviceUserName=user1
SET password=password
SET net4Path=%CD%
ECHO Installing Xignite Service
SET servicePath="%~dp0\path\to\ServiceHost.exe"
SET serviceName=ServiceHostSvc
SC create %serviceName% binPath= %servicePath% DisplayName= "Service1-"%Mode%
SC description %serviceName% "Description here."
SC CONFIG %serviceName% obj= %serviceUserName% password= %password% type= own
ECHO Service1 Installed
ECHO.
SC START %serviceName%
pause
我还能做些什么来解决这个错误吗?
【问题讨论】:
-
如果它对你有用,请参考这篇文章。 get-itsolutions.com/…
-
大家可以看看this article提供的解决方案和this post讨论的内容。