XP Registry - Data for Values not Expanded in Shell Folders Key

Joined
Jan 10, 2007
Messages
43,898
Location
In The Machine
Hi All,

I'm running Windows XP Home Edition & have a query regarding some Registry keys.
The keys involved are HCKU\Software\Microsoft\Windows\Current Version\Explorer\User Shell Folders, and HCKU\Software\Microsoft\Windows\Current Version\Explorer\Shell Folders.* My understanding is that most of the values in the second key are generated automatically from the values in the first key.
The Environment variable USERNAME is defined as "Greg" (without quotes).

In the ...\User Shell Folder key I enter:
Desktop = G:\Documents and Settings\%USERNAME%\Desktop
Templates = G:\Documents and Settings\%USERNAME%\Templates
These values are of type REG_EXPAND_SZ
After rebooting, the values which appear in the ...\Shell Folder key are:
Desktop = G:\Documents and Settings\Greg\Desktop
Templates = G:\Documents and Settings\%USERNAME%\Templates

These values are of type REG_SZ
As these values are of type REG_SZ, I*THINK that %USERNAME% will*not be expanded when the system comes to read it - i.e. the system will look for a folder called G:\Documents and Settings\%USERNAME%\Templates (which does not exist) instead of a folder called G:\Documents and Settings\Greg\Templates.


Two questions:
Will the system expand the %USERNAME% variable in the REG_SZ-type value Templates and find the correct folder?
Is there a reason for the inconsistency between the way that the system generates the values of Desktop and Templates in the ...\Shell Folders key?
Incidentally, ...\User Shell Folder values such as Cache, Cookies, Desktop, Favorites, History, My Music, My Pictures, Nethood, Personal, Programs, Recent, Start Menu and Startup are ALL expanded correctly - i.e. the corresponding values in the ...\Shell Folders key all contain Greg in their paths, whereas ...\User Shell Folder values SendTo, Printhood and Templates are NOT expanded - i.e. the values in the ...\Shell Folders key - all contain %USERNAME% in their paths.

Hope I've explained the situation adequately. Any comments or suggestions would be most welcome.

Best regards,

Greg M


More...

View All Our Microsoft Related Feeds
 
Back
Top