Tuesday, February 8, 2011

Junction Points in Windows

A Junction Point is a physical location on a local hard disk that points to another location on that disk or another storage device. It is essentially a shortcut.
For the most part, you can ignore Junction Points for everyday use of Windows Vista. The Junction Points are in Vista for backward compatibility of pre-Vista applications. Pre-Vista applications (applications written for XP and 2000) look for folders that are no longer used in Vista. Folders with the “My” prefix such as My Documents, My Pictures, and so on.

Junction points can be identified as follows :
They have the FILE_ATTRIBUTE_REPARSE_POINT, FILE_ATTRIBUTE_HIDDEN, and FILE_ATTRIBUTE_SYSTEM file attributes set.
They also have their access control lists (ACLs) set to deny read access to everyone.

User Profiles in Windows Vista
In Windows XP, 2000, 2003, user profiles are stored under c:\Documents and Settings. In Windows Vista (and the soon to be Windows Server 2008 – Longhorn), profiles are now stored under c:\Users. You will see a c:\Documents and Settings folder in Windows Explorer in Vista, but you will also notice the shortcut icon on this folder, and you will not be able to access this folder. c:\Documents and Settings is now a Junction Point. You can use the dir /aL command to see where c:\Documents and Settings points to or use the table below.
The following table lists the old profile path and the corresponding new path under Windows Vista/Longhorn Server.


Old PathNew Path
\Documents and Settings\Users
\Documents and Settings\Default User or
%LOGONSERVER%\NETLOGON\Default User
\Users\Default or
%LOGONSERVER%\NETLOGON\Default
\Documents and Settings\\My Documents\Users\\Documents
\Documents and Settings\\My Documents\My Pictures\Users\\Pictures
\Documents and Settings\\My Documents\My Music\Users\\Music
\Documents and Settings\\Favorites\Users\\Favorites
N/A\Users\\Contacts
N/A\Users\\Downloads
N/A\Users\\SavedGames
\Documents and Settings\\Application Data\Users\\AppData\Roaming
\Documents and Settings\\Local Settings\Application Data\Users\\AppData\Local
\Documents and Settings\\Start Menu\Users\\AppData\Roaming\Microsoft\Windows\ Start Menu
\Documents and Settings\All Users\Users\Public
\Documents and Settings\All Users\Start Menu\ProgramData\Microsoft\Windows\Start Menu
\Documents and Settings\All Users\Desktop\Users\Public\Desktop


Folders to take note of here are the folders in the All Users path. Many older applications that use out of date methods to resolve system folders, will resolve paths under C:\ProgramData when looking for common locations. For example, the common desktop may be resolved as C:\ProgramData\Desktop, however; this is actually a junction point for C:\ProgramData\Users\Public\Desktop. A dir /aL listing in the C:\ProgramData folder reveals the following Junction Points:

PathPoints To
\ProgramData\Application Data\ProgramData
\ProgramData\Desktop\Users\Public\Desktop
\ProgramData\Documents\Users\Public\Documents
\ProgramData\Favorites\Users\Public\Favorites
\ProgramData\Start Menu\ProgramData\Microsoft\Windows\Start Menu
\ProgramData\Templates\ProgramData\Microsoft\Windows\Templates



Environmental Variables
There are also differences in environment variables between Windows Vista and the older versions of Windows. Windows Server 2003 and below define the following variables relating to profiles:

ALLUSERSPROFILE=C:\Documents and Settings\All Users
APPDATA=C:\Documents and Settings\bjohnson\Application Data
HOMEPATH=\Documents and Settings\bjohnson
TEMP=C:\DOCUME~1\bjohnson\LOCALS~1\Temp
TMP=C:\DOCUME~1\bjohnson\LOCALS~1\Temp
USERPROFILE=C:\Documents and Settings\bjohnson

Windows Vista and Longhorn Server define the same variables while adding a couple more.

ALLUSERSPROFILE=C:\ProgramData
APPDATA=C:\Users\bjohnson\AppData\Roaming
HOMEPATH=\Users\bjohnson
LOCALAPPDATA=C:\Users\bjohnson\AppData\Local
ProgramData=C:\ProgramData
PUBLIC=C:\Users\Public
TEMP=C:\Users\bjohnson\AppData\Local\Temp
TMP=C:\Users\bjohnson\AppData\Local\Temp
USERPROFILE=C:\Users\bjohnson


Source:
http://www.svrops.com/svrops/articles/jpoints.htm

No comments:

Post a Comment