Starts a windows service.
StartService(cServiceName | nServiceHandle [, @aArguments [, nTimeout [, cServer [, cDatabase]]]])
Parameters
- cServiceName | nServiceHandle
Either the name of the service or a numeric handle returned from the OpenService function.
- @aArguments (optional)
Array of strings that are passed as arguments to the service.
If you want to omit this parameter but want pass parameters that come after this you can pass NULL instead of a valid array.
- nTimeout (optional)
Maximum time in seconds to wait while the service is in SERVICE_START_PENDING state.
If you pass 0 the function doesn't wait until the service is initiazed, instead it returns immediately after the start request has been sent.
If you omit this parameter or pass NULL the timeout is set to the default timeout reported by the service.
See MSDN help for SERVICE_STATUS_PROCESS structure's "dwWaitHint" member.
- cServer (optional)
The server name on which the service is running.
See MSDN help for OpenSCManager.
- cDatabase (optional)
The database under which the service is registered.
See MSDN help for OpenSCManager.
Return Value
1 if the service was started successful or was already running, 0 if the timeout interval elapsed before the service switched into the running state.
See Also
Reference
ADependentServices
AServiceConfig
AServices
AServiceStatus
CloseServiceHandle
ContinueService
ControlService
CreateService
OpenService
PauseService
StopService
WaitForServiceStatus