Environment Variables - System vs. User

R

Rhino

Can anyone please explain the difference between the 'system' and 'user'
variables in XP (Professional)?

I have an environment variable named classpath which occurs in both the
'system' and 'user' (Rhino) variables on my machine. The values of classpath
are dramatically different in 'system' than in 'user'. When I am logged on
as Rhino, will Windows use the 'user' version of the classpath or does it
concatenate the 'user' and 'system' values of classpath??
 
G

george

Rhino said:
Can anyone please explain the difference between the 'system' and 'user'
variables in XP (Professional)?

I have an environment variable named classpath which occurs in both the
'system' and 'user' (Rhino) variables on my machine. The values of
classpath
are dramatically different in 'system' than in 'user'. When I am logged on
as Rhino, will Windows use the 'user' version of the classpath or does it
concatenate the 'user' and 'system' values of classpath??

Environment variables are 'evaluated' (ie. they are attributed) in the
following order:

1. System variables
2. variables defined in autoexec.bat
3. User variables

so if classpath is defined in all thre of them, the effectively the value
defined as user variable will be the resulting one.

They are not concatenated, the value of a given variable is simply set to
whatever is defined.

There is no difference, it is just a method of having certain variables set
regardless of the user that is logged on (the system variables) and
variables that can be different depending on the user that is logged on.

hth

george
 
W

Wesley Vogel

[[System environment variables are defined by Windows 2000 Server and
are the same no matter who is logged on to the computer. Administrator
group members can add new variables or change the values, however.

User environment variables can be different for each user of a
particular computer. They include any environment variables you want to
define or variables defined by your applications, such as the path where
application files are located.]]


[[System Variables
You must be an administrator to modify a system environment variable.
System environment variables are defined by Windows and apply to all
computer users. Changes to the system environment are written to the
registry, and usually require a restart to become effective.

User Variables for User Name
Any user can add, modify, or remove a user environment variable. These
variables are established by Windows XP Setup, by some programs, and by
users. The changes are written to the registry, and are usually
effective immediately. However, after a change to user environment
variables is made, any open software programs should be restarted to
force them to read the new registry values. ]]

HOW TO Manage Environment Variables in Windows XP
http://support.microsoft.com/default.aspx?scid=kb;en-us;310519

[[User environment variables for logged_on_user_name
The user environment variables are different for each user of a
particular computer. The variables include any that are set by the user,
as well as any variables defined by programs, such as the path to the
location of the program files.

System environment variables
Administrators can change or add environment variables that apply to the
system, and thus to all system users. During installation, Windows Setup
configures the default system variables, such as the path to the Windows
files.]]

Setting environment variables
http://www.microsoft.com/resources/...all/proddocs/en-us/environment_variables.mspx


User Environment Variables
http://msdn.microsoft.com/library/d.../policy/policy/user_environment_variables.asp


--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
 
R

Rhino

Rhino said:
Can anyone please explain the difference between the 'system' and 'user'
variables in XP (Professional)?

I have an environment variable named classpath which occurs in both the
'system' and 'user' (Rhino) variables on my machine. The values of classpath
are dramatically different in 'system' than in 'user'. When I am logged on
as Rhino, will Windows use the 'user' version of the classpath or does it
concatenate the 'user' and 'system' values of classpath??
Thank you both, George and Wesley, for your replies. They helped me solve my
problem!

Rhino
 
G

george

Correct David, I overlooked that one.
:-((
george


"David Candy" <.> wrote in message
Though path is concatinated.
 

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