Windows services SC.exe配置<;servicename>;obj=LocalSystem给出错误消息

Windows services SC.exe配置<;servicename>;obj=LocalSystem给出错误消息,windows-services,Windows Services,命令sc.exe config obj=LocalSystem导致以下错误: 我想创建批处理文件以将特定服务更改为LocalSystem,但上面的命令不起作用。我可以通过services.msc毫无问题地设置LocalSystem 谢谢。对于LocalSystem,必须提供空密码: sc.exe config <servicename> obj= LocalSystem password= "" sc.exe config obj=LocalSystem password=“” 试

命令sc.exe config obj=LocalSystem导致以下错误:

我想创建批处理文件以将特定服务更改为LocalSystem,但上面的命令不起作用。我可以通过
services.msc
毫无问题地设置LocalSystem

谢谢。

对于LocalSystem,必须提供空密码:

sc.exe config <servicename> obj= LocalSystem password= ""
sc.exe config obj=LocalSystem password=“”
试试这个

sc config **Myservice** obj= LocalSystem password= ""
如所述:


如果在调用CreateService或ChangeServiceConfig函数时指定LocalSystem帐户,则会忽略您提供的任何密码信息。

在我的计算机(Windows 7 Professional)上,
sc.exe config obj=。\LocalSystem
(不带伪“password=”参数)可以工作。Windows 7及更高版本可以忽略
password=“”
,而(IIRC,但我不确定)Windows Vista和Windows XP都需要它。
sc config **Myservice** obj= LocalSystem password= ""