Profile Changes in Windows Vista and Windows Server 2008 and beyond

Windows Vista and Windows Server 2008 introduce a number of new user profile paths and environment variables that differ from earlier versions of Windows and these changes may have an impact on scripts such as logon scripts and application install scripts. Most scripts should work correctly - VBScript scripts that use system functions to find folder paths should work as expected, however batch scripts that use environment variables or hard codes scripts will require modifications. Here’s a short run down of the changes.

The following table lists the old profile path and the corresponding new path under Windows Vista/Windows Server 2008:

Old PathNew Path
Documents and SettingsUsers
Documents and Settings\Default UserUsers\Default
Documents and Settings\All Users\Application DataProgramData
Documents and Settings\All Users\Start MenuProgramData\Microsoft\Windows\Start Menu
Documents and Settings\All Users\TemplatesProgramData\Microsoft\Windows\Templates
Documents and Settings\{username}\Local Settings\Application DataUsers\{username}\AppData\Local
N/AUsers\{username}\AppData\LocalLow
Documents and Settings\{username}\Application DataUsers\{username}\AppData\Roaming
Documents and Settings\{username}\CookiesUsers\{username}\AppData\Roaming\Microsoft\Windows\Cookies
Documents and Settings\{username}\NetHoodUsers\{username}\AppData\Roaming\Microsoft\Windows\Network Shortcuts
Documents and Settings\{username}\PrintHoodUsers\{username}\AppData\Roaming\Microsoft\Windows\Printer Shortcuts
Documents and Settings\{username}\RecentUsers\{username}\AppData\Roaming\Microsoft\Windows\Recent
Documents and Settings\{username}\SendToUsers\{username}\AppData\Roaming\Microsoft\Windows\SendTo
Documents and Settings\{username}\Start MenuUsers\{username}\AppData\Roaming\Microsoft\Windows\Start Menu
Documents and Settings\{username}\TemplatesUsers\{username}\AppData\Roaming\Microsoft\Windows\Templates
N/AUsers\{username}\Contacts
Documents and Settings\{username}\DesktopUsers\{username}\Desktop
Documents and Settings\{username}\My DocumentsUsers\{username}\Documents
N/AUsers\{username}\Downloads
Documents and Settings\{username}\FavoritesUsers\{username}\Favorites
N/AUsers\{username}\Links
Documents and Settings\{username}\My Documents\My MusicUsers\{username}\Music
Documents and Settings\{username}\My Documents\My PicturesUsers\{username}\Pictures
N/AUsers\{username}\Saved Games
N/AUsers\{username}\Searches
Documents and Settings\{username}\My Documents\My VideosUsers\{username}\Videos
Documents and Settings\All UsersUsers\Public
Documents and Settings\All Users\DesktopUsers\Public\Desktop
Documents and Settings\All Users\DocumentsUsers\Public\Documents
Documents and Settings\All Users\FavoritesUsers\Public\Favorites
Documents and Settings\All Users\Documents\My MusicUsers\Public\Music
Documents and Settings\All Users\Documents\My PicturesUsers\Public\Pictures
Documents and Settings\All Users\Documents\My VideosUsers\Public\Videos

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 \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 \Users\Public\Desktop. A DIR /A:H listing in C:\ProgramData folder reveals the following junction points:

PathPoints To
ProgramData\Application DataProgramData
ProgramData\DesktopUsers\Public\Desktop
ProgramData\DocumentsUsers\Public\Documents
ProgramData\FavoritesUsers\Public\Favorites
ProgramData\Start MenuProgramData\Microsoft\Windows\Start Menu
ProgramData\TemplatesProgramData\Microsoft\Windows\Templates

These junction points should offer backward compatibility for older applications, however I have found that some of my installation scripts are not cleaning up shortcuts from the public desktop as expected.

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

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

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

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

In practice, I’ve found that scripts that reference locations such as %ALLUSERSPROFILE%\Desktop, are not performing actions as intended and will have to be updated to use %PUBLIC% instead. Certainly something that requires more investigation.

UPDATE: Microsoft have an excellent reference document that details the profile changes in Windows Vista and how roaming profiles should managed in a Windows Vista environment. Check it out for more information that what I’ve listed here:

Managing Roaming User Data Deployment Guide