Using SC.exe to set service credentials password fails

后端 未结 8 1092
野性不改
野性不改 2020-12-10 14:05

I know this question has been asked in the past, but a satisfactory answer has not been provided.

I am using the SC command to config the credentials for a service.<

8条回答
  •  醉酒成梦
    2020-12-10 14:38

    Run against this problem while doing some Powershell scripting and the issue in my case was the special characters in the password.

    Got it working by storing the password in a variable with double quotes around it:

    $servicePassword = "`"passwordWithSpecialCharacters`"" cmd /c sc config myService obj= mydomain\myuser password= $servicePassword

    Special characters are:

    ()'"$><^?

提交回复
热议问题