Click to See Complete Forum and Search --> : Environ variables


SAKYA
August 18th, 2001, 03:40 AM
can someone give me a list of all the environ varibles and what information a can get from them?
Thanks in advance for any reply.

Andyb
August 19th, 2001, 03:55 PM
Dim EnvString, Indx, Msg' Declare variables.
Indx = 1 ' Initialize index to 1.
Do
EnvString = Environ(Indx) ' Get environment
' variable.
IF EnvString >"" THEN MsgBox EnvString'
Indx = Indx + 1
Loop Until EnvString = ""

Iouri
August 20th, 2001, 07:11 AM
Code: Environ("<Param>")

Returns a string, where <Param> can be any of the following:
ALLUSERSPROFILE
APPDATA
CommonProgramFiles
COMPUTERNAME
ComSpec
HOMEDRIVE
HOMEPATH
LOGONSERVER
NUMBER_OF_PROCESSORS
OS
Os2LibPath
Path
PATHEXT
PROCESSOR_ARCHITECTURE
PROCESSOR_IDENTIFIER
PROCESSOR_LEVEL
PROCESSOR_REVISION
ProgramFiles
SystemDrive
SystemRoot
TEMP
TMP
USERDOMAIN
USERNAME
USERPROFILE
windir

If you wish to dump all of the environment variables, this simple piece
of code will work:

For i = 1 To 26
Debug.Print Environ(i) & vbCrLf
Next i


Iouri Boutchkine
iouri@hotsheet.com