Jump to content

Recommended Posts

Posted

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

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...