Skip to content

Service_Stop

Stops the specified service. If the service is already stopped, the function returns True.

Service_Stop(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 stop it, for example because other running services depend on it. giErrorCode contains the return code from Windows.

If bStatus Then bStatus = Service_Stop("Service")

Scripting Guidelines

Service_Exist Service_Delete Constants Package Property Variables