StartService Method

Sends a service start control request to the specified Windows NT service and queries the service status to ensure the service has started. This method will time out after two minutes.

Syntax

obj.StartService(ServiceName String, [ComputerName String], [Arguments String])
Where obj is an OpScrUtil.SCManager object.

Parameters

ServiceName Specifies the name of the service to start.
ComputerName Specifies the target computer. This parameter is optional. If not specified or an empty string, the local computer is the target.
Arguments Specifies arguments to service being started. This parameter is optional.

Return Type

Boolean.

Example

To start the messenger service on the local computer, enter:

Set obj = CreateObject("OpScrUtil.SCManager")
bOK = obj.StartService("Messenger", "")