I'm exploring environment variables via the WMI class Win32_Environment. According to the documentation, a variable that's not of a specific user can be either a "System" variable or a "Default User" variable. My question is, what's the difference, and how I would use one or the other?
Exploring a Windows 2008 machine that's being used as a workstation, I find System variables, but no Default User variables.
The SYSTEM variables are those stored in:
The <DEFAULT> variables are those stored in:
The .DEFAULT user is not the default settings that are created when a user's profile is created for the first time. Rather, .DEFAULT is the HKEY_CURRENT_USER environment used by the LocalSystem security context.
Here's some background from Raymond Chen's blog to give my answer some addt'l credibility: http://blogs.msdn.com/oldnewthing/archive/2007/03/02/1786493.aspx >smile<
I'm not quite sure on this one, but most likely the system variables will be available all the time, wherease the Default User variables only apply as long as the user has not overwritten them.
Not entirely sure....I would assume System variables are system wide, and there is only 1. Default User variables get set for each user, by default, but are independent of each other. Thus in terminal services for example user a can set his tmpdir to something other than user b but both start with the same value set by the default user.