StopService – System Function





StopService Function


Usage

The StopService function stops the specified Windows 2000/XP/2003/Vista Service.

Syntax

StopService(<service_name$>)

or

ret = StopService(<service_name$>)

Parameters

  • <service_name$>: string, system name of the Windows 2000/XP/2003/Vista Service to be stopped.

Return Value

ret, numeric return code. When the specified service has been stopped correctly, the function returns 0; otherwise, use this return code for Error Handling. The return code is 109 if WinTaskAdmin Service is not started. The return code is 5 if access is denied.

See Also

StartService

Example

StopService("WTScheduler") ' Returns 0 if WTScheduler (Service Scheduler) has been correctly stopped.