无法使用sc命令安装服务 [英] Unable to install service using sc command
问题描述
我在此文件夹路径下有我的服务
I have my service under this folder path
C:\Users\Documents\Visual Studio 2012\TestServices\TestServices\InboundMessage.ServiceHost \bin\Debug --->这里是我所有的dll和.exe是
C:\Users\Documents\Visual Studio 2012\TestServices\TestServices\InboundMessage.ServiceHost\bin\Debug --- > here is were all my dlls and .exe is
我使用这个命令安装到我的本地方框
I use this command to install to my local box
sc createReceiver ServicesbinPath =C:\Users\Documents\Visual Studio 2012\TestServices\TestServices\InboundMessage.ServiceHost\InboundMessage.ServiceHost.exe displayname =* Receiver Services
sc create "Receiver Services" binPath= "C:\Users\Documents\Visual Studio 2012\TestServices\TestServices\InboundMessage.ServiceHost\InboundMessage.ServiceHost.exe" displayname= "*Receiver Services"
sc descriptionReceiver ServicesReceiver Services。
sc description "Receiver Services" "Receiver Services."
sc删除Receiver ServicesReceiver Services。
sc delete "Receiver Services" "Receiver Services."
我打开了cmd(c:\windows \System32)并执行上述命令。
I opened my cmd(c:\windows\System32) and execute the above command.
服务已安装,但我无法启动它,因为它抛出的错误:Windows无法在本地机器上启动服务错误2:系统找不到指定的文件。
the service is installed but i am not able to start it because it throw the error: Windows couldn't start the service on local machine Error 2:the system couldn't find the file specified.
EDIT:
我右键点击并检查安装的服务的属性,以检查路径。它与我在命令
I right click and check the property of the service installed to check the path. and it matches the one I put in the command
推荐答案
中输入的一个拼写错误。现在我的服务已启动并正在运行。
there is one spelling error. Now my service is up and running.
这篇关于无法使用sc命令安装服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!