Installs a windows service.
CreateService(cServiceName, cDisplayName, cExecutable [, nServiceType [, nStartType [, nErrorControl [, cLoadOrderGroup [, cDependencies [, cServiceAccount [, cAccountPassword [, cMachine [, cDatabase]]]]]]]]])
Parameters
- cServiceName
The short name of the service.
- cDisplayName
The descriptive name of the service.
- cExecutable
Full path to the service executable.
- nServiceType (optional)
default = SERVICE_WIN32_OWN_PROCESS
The service type.This parameter can be one of the following values. Service type Description SERVICE_FILE_SYSTEM_DRIVER File system driver service. SERVICE_KERNEL_DRIVER Driver service. SERVICE_WIN32_OWN_PROCESS Service that runs in its own process. SERVICE_WIN32_SHARE_PROCESS Service that shares a process with one or more other services. SERVICE_INTERACTIVE_PROCESS If you specify either SERVICE_WIN32_OWN_PROCESS or SERVICE_WIN32_SHARE_PROCESS, and the service is running in the context of the LocalSystem account, you can also specify this value.
- nStartType (optional)
default = SERVICE_AUTO_START
The service start options.This parameter can be one of the following values. Start type Description SERVICE_AUTO_START A service started automatically by the service control manager during system startup. SERVICE_BOOT_START A device driver started by the system loader. This value is valid only for driver services. SERVICE_DEMAND_START A service started by the service control manager when a process calls the StartService function. SERVICE_DISABLED A service that cannot be started. Attempts to start the service result in the error code ERROR_SERVICE_DISABLED. SERVICE_SYSTEM_START A device driver started by the IoInitSystem function. This value is valid only for driver services.
- nErrorControl
default = SERVICE_ERROR_NORMAL
The severity of the error, and action taken, if this service fails to start.This parameter can be one of the following values. Error control Description SERVICE_ERROR_CRITICAL The startup program logs the error in the event log, if possible. If the last-known-good configuration is being started, the startup operation fails. Otherwise, the system is restarted with the last-known good configuration. SERVICE_ERROR_IGNORE The startup program ignores the error and continues the startup operation. SERVICE_ERROR_NORMAL The startup program logs the error in the event log but continues the startup operation. SERVICE_ERROR_SEVERE The startup program logs the error in the event log. If the last-known-good configuration is being started, the startup operation continues. Otherwise, the system is restarted with the last-known-good configuration.
- cLoadOrderGroup (optional)
default = NULL
Return Value
Always .T.
See Also
Reference
ADependentServices
AServiceConfig
AServices
AServiceStatus
CloseServiceHandle
ContinueService
ControlService
OpenService
PauseService
StartService
StopService
WaitForServiceStatus