Junctions act like symbolic links (I call them soft links) to folders. You
can think of them like a shortcut to a folder. This means that when you
access a junction, the system pretends you are accessing the folder it
points to.
The reason I call them soft links is because if you delete the folder the
junction points to, the junction still exists, but will give an error when
you try to access it (the link was soft and it broke when you deleted its
target).
Although junctions act like shell shortcuts, that is not what they are.
Shell shortcuts can only be used from the shell user interface - when an
application is doing a directory or file list, shell shortcuts appear to a
program as a normal file, nothing special. (For example, you cannot follow a
shell shortcut from the command prompt).
In contrast, junctions appear to applications as normal folders. When an
application does a directory listing on the junction, the listing returned
is the listing for the folder the junction points to, although it appears to
the application like the junction contains those files. Also, if an
application accesses a path that contains a junction, such as
\Junction\folder\file.txt, when the system reaches the junction it jumps to
the folder that the junction points to and then continues processing the
path. In this way, the illusion of the junction is complete - no matter how
an application accesses a junction, be it from a directory listing or by
accessing a path that contains a junction, whenever the system sees a
junction it jumps to the folder it points to and completes the operation.
A junction is implemented as a reparse point. This is a feature of NTFS that
allows an application to easily extend the functionality of the file system.
A reparse point is so named because when the file system hits a file that is
tagged as a reparse point, it looks to see which application created the
reparse point, and what data is stored inside the reparse point. Once the
system finds the app that created the reparse point, it forwards processing
to that app, and the app then gets to "reparse" the path and provide its own
functionality.
Reparse points provide the technical base for the creation of junctions as
well as volume mount points in NTFS, and other filesystem constructs
implemented in Windows.
- JB
Vista Support FAQ
http://www.jimmah.com/vista/