Shell.AddEnvironment
--------------------

Adds an entry for environment variables.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Shell](component_Shell.md) | [7.5](newinversion75.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ❌ No |

MBS( "Shell.AddEnvironment"; ShellRef; Name; Value ) 

**MBS**( **"Shell.AddEnvironment";** /\* Adds an entry for environment variables. \*/  
**$ShellRef**; /\* The reference number from the shell.e.g. $shell \*/   
**$Name**; /\* The name of the variable.e.g. "PATH" \*/   
**$Value**) /\* The value of the environment variable.e.g. "C:\\test" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| ShellRef | The reference number from the shell. | $shell |
| Name | The name of the variable. | "PATH" |
| Value | The value of the environment variable. | "C:\\test" |

### Result

Returns OK or error.

### Description

Adds an entry for environment variables.  
### Examples

Try environment functions:

 Set Variable \[ $shell ; Value: MBS ( "[Shell.New](ShellNew.md)" ) \]   
\# set   
Set Variable \[ $s ; Value: MBS ( "Shell.AddEnvironment"; $shell ; "test"; "Hello") \]   
\# and query   
Show Custom Dialog \[ "Environment" ; MBS ( "[Shell.GetEnvironment](ShellGetEnvironment.md)"; $shell ) \]   
Set Variable \[ $r ; Value: MBS ("[Shell.Release](ShellRelease.md)"; $shell ) \]  
### See also

- [Shell.ClearEnvironment](ShellClearEnvironment.md)
- [Shell.GetEnvironment](ShellGetEnvironment.md)
- [Shell.New](ShellNew.md)
- [Shell.Release](ShellRelease.md)

This function checks for a license.

Created 11st November 2017 , last changed 24th February 2018

  
[Shell.AddArgument](ShellAddArgument.md) - [Shell.AvailableBytesError](ShellAvailableBytesError.md)

[HTML Version](ShellAddEnvironment.shtml)