This actually is explained completely by the behavior of junctions - and I
would assume that this is one of the reasons that the shell denies access to
junctions (by default).
"c:\users\USER\Local Settings" is a junction that points to
"c:\users\USER\AppData\Local"
"c:\users\USER\AppData\Local\Application Data" is a junction that points to
the same place.
Here's why...
in Windows XP, the "c:\Documents and Settings\USER\Local Settings" folder
contains a folder named "Application Data" .... but as it turns out, in
Windows Vista, both the "Local Settings" and "Application Data" folders have
been replaced by a single folder "c:\users\USER\AppData\Local".
Which creates a problem ... how do you replace a folder that contains
another folder with just one folder?
Well, in order to support Windows XP applications that access "c:\documents
and settings\USER\Local Settings\Application Data", there is a junction
inside the "c:\users\USER\AppData\Local" folder (where Local Settings points
to) called "Application Data" that points back to itself ... creating a kind
of paradox, as you described.
Here's how it works:
Application accesses "c:\documents and settings\USER\Local
Settings\Application Data\mysettings.file"
Windows goes thru each part of the path, and if it hits a junction it looks
for the next chunk of the path inside the folder that the junction points
to.
So:
- it hits Documents and Settings (junction), and looks for USER inside of
the c:\Users\ folder (target of junction)
- it finds the USER folder (normal folder)
- it hits Local Settings (junction), and looks for Application Data inside
c:\users\USER\AppData\Local (target of junction)
- It hits Application Data (junction), and looks for mysettings.file inside
c:\users\USER\AppData\Local (target of junction)
If the "Application Data" junction wasn't there pointing back to itself,
applications trying to access the old Windows XP location would not work.
Very confusing indeed.
- JB
Vista Support FAQ
http://www.jimmah.com/vista/