我们正在设置一个新的环境,我正在编写批处理文件,以便在集群中的多台机器上使用。一致性是我的朋友。:)
命令行只列出参数并设置errorlevel=1639。
d:\services\WFCContainerStatus>sc config ContainerStatusService start=auto
DESCRIPTION:
Modifies a service entry in the registry and Service Database.
USAGE:
sc <server> config [service name] <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|adapt>
start= <boot|system|auto|demand|disabled|delayed-auto>
error= <normal|severe|critical|ignore>
binPath= <BinaryPathName>
group= <LoadOrderGroup>
tag= <yes|no>
depend= <Dependencies(separated by / (forward slash))>
obj= <AccountName|ObjectName>
DisplayName= <display name>
password= <password>
d:\services\WFCContainerStatus>echo %errorlevel%
1639至少可以说,查找错误代码是一种尝试的经历。尝试使用net helpmsg作为usefil。
d:\services\WFCContainerStatus>net helpmsg 1639
Invalid command line argument. Consult the Windows Installer SDK for detailed command line help.我确信这是我做错了的微不足道的事情,我只是没有意识到这一点。
有人对此有什么想法吗?
发布于 2011-04-09 05:06:17
显然,我需要学习阅读,因为我的答案就在我面前。
d:\services\WFCContainerStatus>sc config ContainerStatusService start= auto
[SC] ChangeServiceConfig SUCCESS正如帮助文本所说,“等号和值之间需要一个空格。”添加空间,一切都会正常工作。
https://stackoverflow.com/questions/5600259
复制相似问题