How to change user credentials of windows service from command line?

sc.exe config "Service Name" obj= "DOMAIN\User" password= "password" type= own

See Shortcut Setting Log-On Credentials for Windows Services ยป jonathanmalek.com.

@MattT points out that on Windows Server 2008R2 you have to add type= own, but prior to that version it isn’t necessary.

In PowerShell 3+, you can avoid escaping the arguments with the stop-parsing symbol: --%

sc.exe --% config "Service Name" obj= "DOMAIN\User" password= "password" type= own

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)