# Service_Exist

> Checks if specified service exists.

Source: https://docs.capaone.com/capainstaller/vb-scripting-library/service-functions/service-exist/  
Product: CapaInstaller — a separate CapaSystems product; do not apply this page to any other.

### Description

Checks if specified service exists

### Syntax

Service_Exist(sServiceName, bMustExist) As Boolean

### Parameters

#### sServiceName (String)

Name of service

#### bMustExist (Boolean)

Service must exist

### Example

**VBScript**

```vb
If bStatus Then bStatus = Service_Exist("ServiceName", False)
If bStatus Then bStatus = Job_WriteLog("Custom", "gbValue: " & gbValue, bStatus, True)
```

[Scripting Guidelines](/capainstaller/vb-scripting-library/scripting-guidelines/)

### Related functions

[Service_GetState](/capainstaller/vb-scripting-library/service-functions/service-getstate/) [Service_SetLogonInformations](/capainstaller/vb-scripting-library/service-functions/service-setlogoninformations/) [Constants](/capainstaller/vb-scripting-library/addendum/constants/) [Package Property](/capainstaller/vb-scripting-library/addendum/package-property/) [Variables](/capainstaller/vb-scripting-library/addendum/variables/)
