SETENVVAR method (System)
Description
This method sets the value of a Windows environment variable.
Syntax
SuccessFlag = Exec_Method( "SYSTEM", "SETENVVAR", EnvVarName, NewValue )
Parameters
Name | Required | Description |
---|---|---|
EnvVarValue | Yes | Name of the environment variable to update. |
NewValue | No | New value for the variable. Defaults to null. |
Returns
TRUE$ if the variable was set successfully, or FALSE$ otherwise.
Remarks
This method is a simple wrapper around the Windows API SetEnvironmentVariable function - further information regarding Windows environment variables may be found on the MSDN website.
Example
// Set the value of the Windows "MyVar" variable SuccessFlag = Exec_Method( "SYSTEM", "SETENVVAR", "MyVar", "SomeNewValue" )
See Also
GETENVVAR method, ENVVARLIST property