Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sc.exe fails with a 1639

We're setting up a new enviroment and I'm writing batch files to used across multiple machines in a cluster. Consistency is my friend. :)

The command line simply lists the parameters and sets the 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

Looking up the error code has been a trying experience to say the least. Trying net helpmsg was as usefil.

d:\services\WFCContainerStatus>net helpmsg 1639

Invalid command line argument. Consult the Windows Installer SDK for detailed command line help.

I'm sure this is something trivial that I'm doing wrong and that I'm simply not seeing it.

Does anyone have any ideas on this?

like image 260
amber Avatar asked Feb 25 '23 13:02

amber


1 Answers

Apparently, I need to learn to read because my answer was right there in front of me.

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

As the help text said, "A space is required between the equal sign and the value." Add the space and everything works.

like image 57
amber Avatar answered Mar 05 '23 16:03

amber