Environment: GetEnvironmentVariable

GetEnvironmentVariable

Returns an environment variable value.



 Public Function GetEnvironmentVariable(
	  ByVal Name As String,
	  Optional ByVal Target As EnvironmentVariableTarget = EnvironmentVariableTarget. Process ) As String

Parameters

Name
[ByVal] String. The name of the environment variable to return.
Target
[ByVal] Optional. EnvironmentVariableTarget. The system region to retrieve the variable from.  

Default: EnvironmentVariableTarget . Process

Return Values

String -  The value of the environment variable.

Remarks

If the variable does not exist, then an empty string is returned.

A Target of Process will retrieve the variable from the current process. Other targets will retrieve the variable value from the registry.

See Also

Project VBCorLib Overview Class Environment Overview Environment Properties Environment Methods GetCommandLineArgs GetEnvironmentVariables