1. Welcome Guest! In order to create a new topic or reply to an existing one, you must register first. It is easy and free. Click here to sign up now!.
    Dismiss Notice

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

Discussion in 'Microsoft News' started by NewsBot, Apr 11, 2008.

  1. NewsBot

    NewsBot I Got News

    Joined:
    Feb 8, 2006
    Messages:
    1,813
    Operating System:
    Windows Vista Home Premium
    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\<!--coloro:#0000ff--><span style="color:#0000ff <!--/coloro--><b>User Shell</b><!--colorc--><!--/colorc--> Folders, and HCKU\Software\Microsoft\Windows\Current Version\Explorer\<b><!--coloro:#008000--><span style="color:#008000 <!--/coloro-->Shell<!--colorc--><!--/colorc--></b> 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 ...\<b><!--coloro:#0000ff--><span style="color:#0000ff <!--/coloro-->User Shell<!--colorc--><!--/colorc--></b> Folder key I enter:
    <blockquote> Desktop = G:\Documents and Settings\%USERNAME%\Desktop
    Templates = G:\Documents and Settings\%USERNAME%\Templates
    These values are of type REG_EXPAND_SZ
    [/quote]
    After rebooting, the values which appear in the ...\<b><!--coloro:#008000--><span style="color:#008000 <!--/coloro-->Shell<!--colorc--><!--/colorc--></b> Folder key are:
    <blockquote> Desktop = G:\Documents and Settings\Greg\Desktop
    Templates = G:\Documents and Settings\%USERNAME%\Templates

    These values are of type REG_SZ
    [/quote] 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:
    <blockquote> 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 ...\<b><!--coloro:#008000--><span style="color:#008000 <!--/coloro-->Shell<!--colorc--><!--/colorc--></b> Folders key?
    [/quote] Incidentally, ...\<b><!--coloro:#0000ff--><span style="color:#0000ff <!--/coloro-->User Shell<!--colorc--><!--/colorc--></b> 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 ...\<b><!--coloro:#008000--><span style="color:#008000 <!--/coloro-->Shell<!--colorc--><!--/colorc--></b> Folders key all contain Greg in their paths, whereas ...\<b><!--coloro:#0000ff--><span style="color:#0000ff <!--/coloro-->User Shell<!--colorc--><!--/colorc--></b> Folder values SendTo, Printhood and Templates are NOT expanded - i.e. the values in the ...\<b><!--coloro:#008000--><span style="color:#008000 <!--/coloro-->Shell<!--colorc--><!--/colorc--></b> 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




     

Share This Page