User Shell Folders - Profile, Start Menu folder...

In Windows 7/2008 the main User Profile folder (%USERPROFILE%) has moved from C:\Documents and Settings\ to C:\Users\ and many profile folders have also changed name or location:

 Windows XP/2003                Windows 7/2008

%USERPROFILE%\Application Data %USERPROFILE%\AppData\Roaming
%USERPROFILE%\Cookies          %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Cookies
%USERPROFILE%\History          %USERPROFILE%\AppData\Local\Microsoft\Windows\History
%USERPROFILE%\Local Settings   %USERPROFILE%\AppData\Local
%USERPROFILE%\My Documents     %USERPROFILE%\Documents
%USERPROFILE%\NetHood          %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Network Shortcuts
%USERPROFILE%\PrintHood        %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Printer Shortcuts
%USERPROFILE%\Recent           %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Recent
%USERPROFILE%\SendTo           %USERPROFILE%\AppData\Roaming\Microsoft\Windows\SendTo
%USERPROFILE%\Start Menu       %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu
%USERPROFILE%\Templates        %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Templates
%USERPROFILE%\Temporary Internet Files %USERPROFILE%\AppData\Local\Microsoft\Windows\Temporary Internet Files

 Windows XP/2003                Windows 10/2012 R2

%USERPROFILE%\Application Data %USERPROFILE%\AppData\Roaming
%USERPROFILE%\Cookies          %USERPROFILE%\AppData\Local\Microsoft\Windows\INetCookies
%USERPROFILE%\History          %USERPROFILE%\AppData\Local\Microsoft\Windows\History
%USERPROFILE%\Local Settings   %USERPROFILE%\AppData\Local
%USERPROFILE%\My Documents     %USERPROFILE%\Documents
%USERPROFILE%\NetHood          %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Network Shortcuts
%USERPROFILE%\PrintHood        %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Printer Shortcuts
%USERPROFILE%\Recent           %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Recent Items
%USERPROFILE%\SendTo           %USERPROFILE%\AppData\Roaming\Microsoft\Windows\SendTo
%USERPROFILE%\Start Menu       %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu
%USERPROFILE%\Templates        %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Templates
%USERPROFILE%\Temporary Internet Files %USERPROFILE%\AppData\Local\Microsoft\Windows\INetCache

The values above can be found in the registry (as REG_EXPAND_SZ values)
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders

The following HKCU registry subkeys are common to Windows XP/2003/7/2008 :

AppData, Cache, Cookies, Desktop, Favorites, History, LocalAppData, My Pictures, NetHood, Personal, PrintHood, Programs, Recent, SendTo, Start Menu, Startup, Templates.

By default these all resolve to subfolders below %USERPROFILE% but they can be redirected to other locations.
The registry locations are always the same, but the files and folders may be in different places.

To provide backwards compatibility, in Windows 7 and above the old locations under C:\Documents and Settings contain junction points (hidden, protected operating system files) which point to the new user-accessible folders.

'All Users' Shell Folders

The folders for All Users settings have also moved:

 Windows XP/2003                      Windows 7/2008

%ALLUSERSPROFILE%\Application Data    %ProgramData%
%ALLUSERSPROFILE%\Desktop             %PUBLIC%\Desktop
%ALLUSERSPROFILE%\Documents           %PUBLIC%\Documents
%ALLUSERSPROFILE%\Start Menu\Programs %ProgramData%\Microsoft\Windows\Start Menu\Programs
%ALLUSERSPROFILE%\Start menu          %ProgramData%\Microsoft\Windows\Start Menu
%ALLUSERSPROFILE%\Start Menu\Programs\Startup  %ProgramData%\Microsoft\Windows\Start Menu\Programs\Startup
%ALLUSERSPROFILE%\Templates           %ProgramData%\Microsoft\Windows\Templates

 Windows XP/2003                      Windows 10/2012 R2

%ALLUSERSPROFILE%\Application Data    %ProgramData%
%ALLUSERSPROFILE%\Desktop             %PUBLIC%\Public Desktop
%ALLUSERSPROFILE%\Documents           %PUBLIC%\Public Documents
%ALLUSERSPROFILE%\Start Menu\Programs %ProgramData%\Microsoft\Windows\Start Menu\Programs  *
%ALLUSERSPROFILE%\Start menu          %ProgramData%\Microsoft\Windows\Start Menu  *
%ALLUSERSPROFILE%\Start Menu\Programs\Startup  %ProgramData%\Microsoft\Windows\Start Menu\Programs\Startup  *
%ALLUSERSPROFILE%\Templates           %ProgramData%\Microsoft\Windows\Templates

* In Windows 10 the Start Menu items are held in a database that is stored under C:\Users\accountname\AppData\Local\TileDataLayer this is proprietary, non user editable and limited to 500 shortcuts. It is also used for Cortana Search. The entire database can be copied between accounts - all or nothing.

The values above can be found in the registry (as REG_EXPAND_SZ values)
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders
The entries in this subkey can appear in both the Shell Folders subkey and the User Shell Folders and in both HKLM and HKCU. The entries that appear in User Shell Folders take precedence over those in Shell Folders.
The entries that appear in HKCU take precedence over those in HKLM

The following HKLM registry subkeys are common to Windows XP/2003/7/2008 :

Common AppData, Common Desktop, Common Documents, Common Programs, Common Start Menu, Common Startup, Common templates

Folder Redirection

Although it is possible to redirect any of these folders with Group Policy, not all options are fully supported,
for example redirecting IE favorites/cookies will result in very slow performance.

Examples

Find the location of the Start Menu folder:

For /f "tokens=3*" %%G in ('REG QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Start Menu" ^|Find "REG_"') do Call Set _startmenu=%%H

Echo %_startmenu%

PowerShell function to open the Start menu:

function Open-StartMenu {
$drive = dir env:SystemDrive
$w7path = $drive.value + "\ProgramData\Microsoft\Windows\Start Menu"
$xppath = $drive.value + "\Documents and Settings\All Users\Start Menu"
if (test-path $w7path)
 {explorer $w7path}
elseif (test-path $xppath) {explorer $xppath}
}

“There are no shortcuts to any place worth going” - Beverly Sills

Related:

Shell: folder - Shortcuts to key folders.
Windows Environment Variables
RoamingProfile.vbs - Cleardown files to improve logon and logoff times.
Managing Roaming User Data Deployment Guide - TechNet (html and .doc)
Q886549 - User Shell Folders


© Copyright SS64.com 1999-2016
Some rights reserved