# Env_GetString

> Gets value of specified environment variable.

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

### Description

Gets value of specified environment variable

### Syntax

Env_GetString(sName, sType, bMustExist) As Boolean

### Parameters

#### sName (String)

Environment variable name.

#### sType (String)

Environment variable type. 'System', 'User' or 'Process'

#### bMustExist (Boolean)

Environment variable must exist

### Return value

Result will be stored in gsValue

### Example

**VBScript**

```vb
If bStatus Then bStatus = Env_GetString("Path", "System", True)
If bStatus Then bStatus = Job_WriteLog("Custom", "gsValue: " & gsValue, bStatus, True)
```

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

### Related functions

[Env_SetString](/capainstaller/vb-scripting-library/environment-functions/env-setstring/) [Constants](/capainstaller/vb-scripting-library/addendum/constants/) [Package Property](/capainstaller/vb-scripting-library/addendum/package-property/) [Variables](/capainstaller/vb-scripting-library/addendum/variables/)
