StopService Method

Action2 Example

Windows NT Machines Only

 

Encapsulates the AutoMate™ action in the “Services” group, “Stop a service.” The method attempts to stop the specified service.

 

Declaration

function StopService (varServiceName As Variant) As Integer

 

Parameters

varServiceName

 The name of the service (as it appears in the SCM) to stop.

 

Description

The PauseService method attempts to stop the service named varServiceName. The service must have the ability to be stopped. Check the documentation for the service if you are unsure whether or not it supports pausing.

 

The method returns “0” if the service was stopped successfully; otherwise, it returns “1.” Use the GetLastError property to retrieve the error message generated by a failed stop attempt.