Environment: SetEnvironmentVariable

SetEnvironmentVariable

Sets, creates, or deletes an environment variable in the specified region.



 Public Sub SetEnvironmentVariable(
	  ByRef Variable As String,
	  ByRef Value As String,
	  Optional ByVal Target As EnvironmentVariableTarget = Process )

Parameters

Variable
[ByRef] String. The name of the variable to set the value for.
Value
[ByRef] String. The value of the variable.
Target
[ByVal] Optional. EnvironmentVariableTarget. The region the variable is located in the system.  

Default: Process

Remarks

Setting the variable in the Process region only affects the current process that is setting the variable. Setting a variable in a User or Machine region will set the values in the registry.

by setting the value to an empty string, the variable will be deleted.

See Also

Project CorLib Overview

Class Environment Overview