Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SC.exe config <servicename> obj= LocalSystem is giving error

The command sc.exe config <servicename> obj= LocalSystem results in the following error:

The account name is invalid or does not exist,
or the password is invalid for the account name specified.

I want to create batch file to change a particular service to LocalSystem but the above command does not work. I can set LocalSystem via services.msc without problems.

Thanks.

like image 586
user507779 Avatar asked Nov 15 '10 02:11

user507779


People also ask

What is the sc config command?

Specifies a name of an account in which a service will run, or specifies a name of the Windows driver object in which the driver will run. The default setting is LocalSystem.

Where is SC exe located?

The sc.exe command comes with Windows XP and is in the system32 subdirectory of the Windows installation directory (usually either C:\windows\system32 or C:\winnt\system32). As of this writing, the Windows 2000 sc.exe is available for download at ftp://ftp.microsoft.com/reskit/win2000/sc.zip.

What is the SC exe command?

Reference article for the sc.exe query command, which obtains and displays information about the specified service, driver, type of service, or type of driver.

What is SC in powershell?

Service Control - Create, Start, Stop, Query or Delete any Windows SERVICE.


2 Answers

For LocalSystem an empty password must be provided:

sc.exe config <servicename> obj= LocalSystem password= ""
like image 109
user507779 Avatar answered Jan 02 '23 21:01

user507779


try this...

sc config **Myservice** obj= LocalSystem password= ""
like image 38
Kirit Parekh Avatar answered Jan 02 '23 20:01

Kirit Parekh