Skip to content

Service_Start

Starts the specified service. If the service is already running, the function returns True.

The function doesn’t wait until the service is running. To wait for it, call Service_WaitForStart afterwards.

Service_Start(sServiceName) As Boolean

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

The function returns False if the service doesn’t exist, or if Windows can’t start it. giErrorCode contains the return code from Windows.

If bStatus Then bStatus = Service_Start("Service")

Scripting Guidelines

Service_Create Service_Exist Service_SetStartMode Service_WaitForStart Constants Package Property Variables