The Environ function returns the string associated with an operating system environment variable.
Syntax | |||||
Environ(Element) | |||||
Return value | |||||
Type |
Description | ||||
String |
The value of the queried environment name. | ||||
Parameter | |||||
Use |
Name |
Type |
Passing |
Description | |
Required |
Element |
String |
ByVal |
The environment value to be queried | |
The element parameter passes either the name of an environment variable or a numeric expression according to the numeric order of the environment string in the environment string table.
If the passed name cannot be found in the environment string table, a zero string ("") is returned. Otherwise, the text assigned to the specified environment string is returned. This is the text specified after the equal sign (=) in the environment string table for this environment variable.
If you specify a numeric expression, it returns the string that represents environment strings at the corresponding numeric location in the table. In this case, the Environ function returns all the text (including the passed parameter). If there is no environment string at the specified location, a zero string ("") is returned.
Example:
MsgBox(Server.Environ("Path"))
This example determines the contents of the Path variable on the Windows system. The path variable stores the access paths for finding files in the windows system.