Environ Function - List of environment variable
Apr 28 2005, 12:50 PM
From: NY - USA
Provided is a list of common environment variables. Also, code is provided (courtesy of Rob Cooper - Microsoft Access Team) that loops to enumerate custom environment variables.
Courtesy of Rob Cooper
Custom environment variables could also be created and vary by system. You can write a loop to enumerate them:
Dim i As Integer
Dim stEnviron As String
For i = 1 To 50
' get the environment variable
stEnviron = Environ(i)
' see if there is a variable set
If Len(stEnviron) > 0 Then
Debug.Print i, Environ(i)
I typically use 50 for the loop because I've always had less than that, but you could certainly increase it if needed. This code will print out the name and value of the environment variables on a given machine.
|Go to Top · Lo-Fi Version||Time is now: 20th May 2013 - 07:50 PM|