CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2000
    Posts
    104

    Environ variables

    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.


  2. #2
    Join Date
    Jun 1999
    Location
    England
    Posts
    86

    Re: Environ variables

    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 = ""


  3. #3
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: Environ variables

    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
    [email protected]
    Iouri Boutchkine
    [email protected]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured