• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1210
  • Last Modified:

Automatically setting default locations of Cookies/Desktop/Favourites/My Document/My Pictures for a new user

I've maxed out all my points for this one (would love to give more!)....

Hi, first let me explain this is not the common regedit My PC\HKEY_CURRENT_USER, use TweakUI Powertool issue or right-click My Documents -> Move.....  I already know how to do all the above manually like this for each user.  I want a way to do this automatically before it creates the default folders, and presume it needs to be setup before I create users - no problem.  However I want the default accounts (e.g. Administrator) to reside at their usual location so changing the location of the entire "Documents and Settings" folder by customising the XP installation CD is a big no-no.

So my initial test was to change the HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders registry entries.  After all, in HKEY\USERS\.DEFAULT are the keys that are used to "define" a new user when he first logs on and his profile is created - aren't they?

So here is what I did (and it didn't work):

In this example let's just use the Desktop folder, I want it to point to D:\<username>\Desktop

I located the key HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\Desktop

I changed it from %USERPROFILE%\Desktop to D:\%USERNAME%\Desktop

I made sure I had a folder called D:\Fred\Desktop (with total permissons) and then I created the user Fred expecting his Desktop to point to D:\Fred\Desktop.  It doesn't - it points C:\Documents and Settings\Fred\Desktop  :(  I also tried this again without creating the Fred folder.

So is there a way to to this without using Roaming Profiles (this is a local non-networked machine), or without having to do all users manually ?

Thanks in advance

1 Solution

An important point here!

.DEFAULT contains the per&#8722;user settings that Windows XP uses to display the desktop
before any user logs on to the computer. This isn't the same thing as a default user profile, which Windows XP uses to create settings for users the first time they log on to the computer.

So, what you want to do is to customize the shell folders in the 'Default User' NTUSER.DAT hive. See: http://www.dougknox.com/xp/tips/xp_adv_reg_editing.htm

If you want to customize the 'Default User' profile more extensively, see this KB:

Additional note regarding Shell Folder, from my site!

Reset the Shell Folders paths to defaults:
How to redirect Special folders in Windows XP:
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

JimBsAsAuthor Commented:
Thank you very kindly Sir - you are either a genius or better at googling than I ! :p

320 points (all my credit) is now on it's way.
So it Strikes me that in reading all this that it comes to knowing two critical pieces of info and if you can change that you can redirect all profiles.

Windows registry uses the environment variable %USERPROFILE% to specify a variable name for the path to the profile but nowhere can I find in the registry where the path is being mapped to the variable %USERPROFILE%.

The value cannot be stored in and data structure in the documents and setting path, because when windows goes to load a profile it has to know what the path is to documents and settings. Surely '%systemdrive%\documents and settings' is NOT hard coded in the O/S and thus not relocatable entirely. It has GOT to be possible to tell windows the entire documents and settings directory structure exists on say D:

So I'm thinking, if I could find out where the mapping to %USERPROFILE% is set AND where windows retrieves the base mapping to %systemdrive%\documents and settings You could tackle the issue at the root when setting up windows initially. What if you want to relocate the ENTIRE profiles structure to other than C:\documents and settings?

Does that make sense? any answers, thoughts, comments?  
AFAIK the %userprofile% is set from \system32\userenv.dll
also see

to change the profile to another location, MS has 2 methods, both explained in
although the kb is supposedly only for win2k, the following kb clearly state that the info applies to xp as well:
under the more info heading, last line:
"The resolution procedure in 236621 also applies to Windows XP"

in short - either in-place reinstall windows with /UNATTEND* or use a 3rd party registry editor to search and replace a string in the entire registry (keys, vlaues and data).
registry workshop (1.6.4 from torchsoft.com) is not free but works very well from my experience.
I used it to also change the \program files\common files ( \progra~1\common~1 ) pairs to a different volume base.
this is of particular importance when running low on space in C:\ as even when installing to a diff location windows will throw a lot of junk into the c:\p-f\c-f dir (on a new comp after installing a full suit of office2k3 to volume d, c:\ was down almost 1GB in common files alone)

* in kb315341 there is no mention of using /UNATTEND in in-place reinstall, and I have not tested this myself so this could be risky.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now