List of Environ expressions

D

Desert Piranha

Hi all,

Have Googled, helped and Microsofted, No joy.

Is there such a thing as list of the expressions used for the "Environ"
function?

IE:
'=Environ(UserName)
'=Environ(Path)
etc.
 
S

Steve Yandl

I don't know if this is complete but it should give you something to work
with.


ALLUSERSPROFILE
APPDATA
COLLECTIONID
CommonProgramFiles
ComputerName
ComSpec
FP_NO_HOST_CHECK
HMSERVER
HOMEDRIVE
HOMEPATH
ITEMID
LANG
LOGONSERVER
NUMBER_OF_PROCESSORS
OS
OSVER
Path
PATHEXT
PROCESSOR_ARCHITECTURE
PROCESSOR_IDENTIFIER
PROCESSOR_LEVEL
PROCESSOR_REVISION
ProgramFiles
PROMPT
SESSIONID
SESSIONNAME
SWUTVER
SystemDrive
TEMP
TIMEOUT
TMP
TOOLPATH
tvdumpflags
UPDATEDIR
USERDOMAIN
USERNAME
USERPROFILE
VERSION
winbootdir
windir


Steve Yandl



"Desert Piranha"
 
T

Tom Ogilvy

It depends on your operationg system. You can get your list with

Sub ShowEnviron()
On Error Resume Next
For i = 1 To 100
Cells(i, 1) = Environ(i)
Next

End Sub

--
Regards,
Tom Ogilvy




"Desert Piranha"
 
N

NickHK

Tom,
Are these indices fixed across OSs ?
i.e. 1 always returns ALLUSERSPROFILE ?

NickHK

Tom Ogilvy said:
It depends on your operationg system. You can get your list with

Sub ShowEnviron()
On Error Resume Next
For i = 1 To 100
Cells(i, 1) = Environ(i)
Next

End Sub

--
Regards,
Tom Ogilvy




"Desert Piranha"
message news:D[email protected]...
 
T

Tom Ogilvy

Hey NickHK
I would think not, because I am using Windows 98SE and only have about 8
environment variables and they are numbered consecutively starting with 1.
ALLUSERSPROFILE isn't one of them.


TMP=C:\WINDOWS\TEMP
TEMP=C:\WINDOWS\TEMP
PROMPT=$p$g
winbootdir=C:\WINDOWS
PATH=C:\Program Files\Microsoft Office\Office;C:\WINDOWS;C:\WINDOWS\COMMAND
COMSPEC=C:\WINDOWS\COMMAND.COM
windir=C:\WINDOWS
BLASTER=A220 I5 D1 T4 P330


Recognize that you can define your own.
 
N

NickHK

Tom,
OK, I suppose that makes sense.

NickHK


Tom Ogilvy said:
Hey NickHK
I would think not, because I am using Windows 98SE and only have about 8
environment variables and they are numbered consecutively starting with 1.
ALLUSERSPROFILE isn't one of them.


TMP=C:\WINDOWS\TEMP
TEMP=C:\WINDOWS\TEMP
PROMPT=$p$g
winbootdir=C:\WINDOWS
PATH=C:\Program Files\Microsoft Office\Office;C:\WINDOWS;C:\WINDOWS\COMMAND
COMSPEC=C:\WINDOWS\COMMAND.COM
windir=C:\WINDOWS
BLASTER=A220 I5 D1 T4 P330


Recognize that you can define your own.
 
K

keepITcool

it's the same list you get from the "Dos" Prompt
in a console window.

run CMD.exe
type SET [enter]

it's slightly different when you run COMMAND.com
 
D

Desert Piranha

Hi all,
Thank to everyone who contributed to this thread.

Tom, Kool little macro.

Thank you all
Dave

Tom said:
It depends on your operationg system. You can get your list with

Sub ShowEnviron()
On Error Resume Next
For i = 1 To 100
Cells(i, 1) = Environ(i)
Next

End Sub

--
Regards,
Tom Ogilvy




"Desert Piranha"
message
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top