SC Create command syntax

This topic describes the various options of the SC command with the Create command option.

The SC command communicates with the Windows Service Controller and installed services. When used with its create command option, you can use it to create a Windows service under which the Endeca Server will run.

The SC Create command uses the following format:
sc create serviceName binpath= "path\to\service-wrapper-7.4.exe" optionName= optionValue...
where:
  • create is the command to be run by SC (this command name is mandatory to create a service).
  • serviceName is the name of the Windows service to be created. This is the name given to the service key in the registry. Note that this name is different from the display name.
  • binpath is a mandatory parameter that specifies the path to the service-wrapper-7.4.exe file. Note that a space must be used between the binpath parameter and its argument. You should also use double quotes around the argument.
  • optionName specifies optional parameters, which are described in the table below.

SC Create options

You can use these SC Create options to further customize the Windows service. Note that the option name includes the equal sign, and a space is required between the equal sign and the option value.
Option Name/Values Meaning
type= <serviceType> The type of service to be created. Use the own parameter value, which means the service runs in its own process. It does not share an executable file with other services. This is the default for the sc create command. Note that other service types are available, but you should use the own value.
start= <startType> The start type for the service:
  • auto – A service that automatically starts each time the computer is restarted.
  • demand – A service that must be manually started. This is the default value if start= is not specified. demand maps to Manual in the Services Control Manager.
  • delayed-auto – The SCM supports delayed auto-start services to improve system performance at boot time without affecting the user experience. The SCM makes a list of delayed auto-start services during boot and starts them one at a time after the delay has passed, honoring dependencies. There is no specific time guarantee as to when the service will be started.
  • disabled – A service that cannot be started. To start a disabled service, change the start type to another start value.
error= <errorSeverity> The severity of error if the service does not start during boot:
  • normal – The error is logged and a message box is displayed informing the user that a service has failed to start. System startup will continue. This is the default setting.
  • severe – The error is logged (if possible). The computer attempts to restart with the last-known-good configuration. This could result in the computer being able to restart, but the service may still be unable to run.
  • critical – The error is logged (if possible). The computer attempts to restart with the last-known-good configuration. If the last-known-good configuration fails, system startup also fails, and the boot process halts with a Stop error.
  • ignore – The error is logged and startup continues. No notification is given to the user beyond recording the error in the Event Log.
group= <loadOrderGroup> Name of group of which this service is a member. The list of groups are stored in the registry under the ServiceGroupOrder key. Default is null.
tag= yes|no Do not use this parameter as tags are used only for device driver service types.
depend= <dependencies> Names of services or groups that must start before this service. Each name is separated by / (forward slash).
obj= <accountName> Name of the account under in the service will run. The specified account must exist and must be a valid account. Default is LocalSystem.
password= <password> Password of the obj account. A password is required if an account other than the LocalSystem account is used.
displayname= <displayName> A friendly, meaningful name that can be used in user-interface programs to identify the service to users. For example, if the service name is ESService, you can specify Oracle Endeca Server as the display name so that will be more meaningful when shown in the Windows Services Control Manager.

SC Create example

The following SC Create example creates a Windows service for the Endeca Server (note that the command is on one line, but is indented here for ease of reading):
sc create EndecaServer displayname= "Oracle Endeca Server" 
  type= own error= severe obj= "CORPDEV\EndecaUser" password= banx912
  binpath= "C:\Oracle\Endeca\Server\7.4.0\endeca-server\service-wrapper-7.4.exe"
The sample command does the following:
  • Creates a Windows service named EndecaServer.
  • Uses Oracle Endeca Server as the display name for the service.
  • Sets the service type as own (which means the service runs in its own process).
  • Sets severe as the severity of error if the service does not start during the boot process.
  • Specifies that the service run under the CORPDEV\EndecaUser user account, which has banx912 as its password.
  • Sets the binary path of the service-wrapper-7.4.exe executable.

For ease of use, you can place the command in a batch script.