My Assistant
![]() ![]() |
|
|
Apr 28 2005, 12:50 PM
Post
#1
|
|
|
UtterAccess VIP Posts: 4,034 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.
ALLUSERSPROFILE APPDATA AVENGINE CLIENTNAME CommonProgramFiles COMPUTERNAME ComSpec FP_NO_HOST_CHECK HOMEDRIVE HOMEPATH INCLUDE INOCULAN LIB LOGONSERVER NUMBER_OF_PROCESSORS OS Path PATHEXT PROCESSOR_ARCHITECTURE PROCESSOR_IDENTIFIER PROCESSOR_LEVEL PROCESSOR_REVISION ProgramFiles SESSIONNAME SystemDrive SystemRoot TEMP TMP USERDOMAIN USERNAME USERPROFILE VS71COMNTOOLS WecVersionForRosebud.FF0 windir Courtesy of Rob Cooper Custom environment variables could also be created and vary by system. You can write a loop to enumerate them: CODE Sub test() 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) Else Exit For End If Next End Sub 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 |