Command line sc.exe因1639错误而失败

Command line sc.exe因1639错误而失败,command-line,windows-services,windows-server-2008-r2,Command Line,Windows Services,Windows Server 2008 R2,我们正在建立一个新环境,我正在编写批处理文件,以便在集群中的多台机器上使用。一致性是我的朋友。:) 命令行只列出参数并设置errorlevel=1639 d:\services\WFCContainerStatus>sc config ContainerStatusService start=auto DESCRIPTION: Modifies a service entry in the registry and Service Database. USAGE:

我们正在建立一个新环境,我正在编写批处理文件,以便在集群中的多台机器上使用。一致性是我的朋友。:)

命令行只列出参数并设置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
我确信这是一件小事,我做错了,我只是没有看到它


有人对此有什么想法吗?

显然,我需要学习阅读,因为我的答案就在眼前

d:\services\WFCContainerStatus>sc config ContainerStatusService start= auto
[SC] ChangeServiceConfig SUCCESS

正如帮助文本所说,“在等号和值之间需要一个空格。”添加空格,一切都会正常工作。

疯狂!我自己就碰到这个。Windows 10和服务器2019(可能是2016年)似乎不需要空间,但Windows 7也需要空间(猜测服务器2008)。虽然这些功能现在已不受支持,但对于付费的Pro/Enterprise volume用户(直到2023年),它们仍然适用于扩展安全更新。
d:\services\WFCContainerStatus>sc config ContainerStatusService start= auto
[SC] ChangeServiceConfig SUCCESS