Home > Language Reference > System Functions > IsServiceStarted

IsServiceStarted

The IsServiceStarted function checks if the specified service is started.

Usage

Used to check if a service is started and take conditional action depending on the result.

Syntax

var = IsServiceStarted(<service_name>)

Parameters

<service_name>. string, name of the service to check (case insensitive). 

Return value

var, integer. If <service_name> is started, the return value is 1. If it is not started, the return value is 0. If the function fails, the return value is different from 0 and from 1 (see System Functions Error codes).

See also

StartService
StopService

Example

a = IsServiceStarted("WTScheduler") ' Returns 1 if the WTScheduler service (the WinTask Scheduler) is started.