Service_WaitForStart
Description
Section titled “Description”Waits until the specified service is running, or until the timeout is exceeded. The function checks the state of the service every second.
Syntax
Section titled “Syntax”Service_WaitForStart(sServiceName, iTimeOutInSec) As Boolean
Parameters
Section titled “Parameters”sServiceName (String)
Section titled “sServiceName (String)”Name of the service. Use the service name, for example Spooler, not the display name.
iTimeOutInSec (Integer)
Section titled “iTimeOutInSec (Integer)”Maximum number of seconds to wait for the service to start
Return value
Section titled “Return value”The function always returns True, also when the service doesn’t start within the timeout. A timeout is written to the package log as an error. To check that the service is running, call Service_GetState afterwards.
Example
Section titled “Example”If bStatus Then bStatus = Service_WaitForStart("Service", 90)Related functions
Section titled “Related functions”Service_Create Service_Exist Service_SetStartMode Constants Package Property Variables