Skip to content

Service_WaitForStart

Waits until the specified service is running, or until the timeout is exceeded. The function checks the state of the service every second.

Service_WaitForStart(sServiceName, iTimeOutInSec) As Boolean

Name of the service. Use the service name, for example Spooler, not the display name.

Maximum number of seconds to wait for the service to start

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.

If bStatus Then bStatus = Service_WaitForStart("Service", 90)

Scripting Guidelines

Service_Create Service_Exist Service_SetStartMode Constants Package Property Variables