|
|
Title | Display all of a program's environment variables |
Keywords | environment variables |
Categories | Software Engineering, Windows |
|
|
The Environ function takes as a parameter either the name of a variable or an index into the collection of variables defined. To list all of the environment variables, pass the function increasing indexes until it returns an empty string.
|
|
Private Sub Form_Load()
Dim i As Integer
Dim txt As String
i = 1
Do
If Environ(i) = "" Then Exit Do
txt = txt & Environ(i) & vbCrLf
i = i + 1
Loop
Text1.Text = txt
End Sub
|
|
|
|
|
|