我正在尝试跟随this website并安装一个我们有作为服务的程序。
这就是我所拥有的:
SC CREATE SqlPort binPath= “D:\RPG\VbLib\SqlPort\SqlPort\srvstart.exe SqlPort -c D:\RPG\VbLib\SqlPort\SqlPort\sqlport.ini” DisplayName= SqlPort start= auto当我按回车键时,它会给我帮助:
DESCRIPTION:
Creates a service entry in the registry and Service Database.
USAGE:
sc <server> create [service name] [binPath= ] <option1> <option2>...
OPTIONS:
NOTE: The option name includes the equal sign.
A space is required between the equal sign and the value.
type= <own|share|interact|kernel|filesys|rec>
(default = own)
start= <boot|system|auto|demand|disabled|delayed-auto>
(default = demand)
error= <normal|severe|critical|ignore>
(default = normal)
binPath= <BinaryPathName>
group= <LoadOrderGroup>
tag= <yes|no>
depend= <Dependencies(separated by / (forward slash))>
obj= <AccountName|ObjectName>
(default = LocalSystem)
DisplayName= <display name>
password= <password>我已经将帮助与我所拥有的进行了比较,我看不出有任何问题。这是在Windows7 x64系统上。
有人看到我做错了什么吗?
发布于 2013-04-24 00:45:39
粘贴的文本中有“和”。您可能希望尝试用普通的"引号替换它们。
发布于 2016-06-10 21:45:29
我遇到过这样的问题,我的引号也没问题...终于弄明白了-- '=‘后面必须有一个空格!
也就是说,这不起作用/导致'help‘转储:
C:\>sc create "My Service" binPath="C:\MyService\MyService.exe"但这是可行的:
C:\>sc create "My Service" binPath= "C:\MyService\MyService.exe"原始问题中描述的行为比不适当的引号更“通用”。它是操作系统对以任何方式不正确格式化的命令的反应方式。它可能是任何非ANSI字符,也可能是命令格式的其他问题(例如"binPath“拼写错误等)。
发布于 2019-10-09 20:44:51
有三件事非常重要。
应该编写
binPath= "而不是binPath="或binPath = "关注空间
必须正确编写的
"
“不正确,"正确
以administrator身份运行
示例
sc create "Service Name" binPath= "E:\ServiceFolder\ServiceName.exe"还要注意,您还需要为每个可选属性提供一个空格。
例如,start=auto应为start= auto
https://stackoverflow.com/questions/16174736
复制相似问题