Link to home
Start Free TrialLog in
Avatar of JimBsAs
JimBsAs

asked on

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

Jim
ASKER CERTIFIED SOLUTION
Avatar of sramesh2k
sramesh2k
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Additional note regarding Shell Folder, from my site!

Reset the Shell Folders paths to defaults:
http://www.mvps.org/sramesh2k/usershellfolders.htm
How to redirect Special folders in Windows XP:
http://www.mvps.org/sramesh2k/RedirectFolders.htm
Avatar of JimBsAs
JimBsAs

ASKER

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?  
Phil
AFAIK the %userprofile% is set from \system32\userenv.dll
also see
http://support.microsoft.com/default.aspx?scid=kb;en-us;834239&Product=winxp

to change the profile to another location, MS has 2 methods, both explained in
http://support.microsoft.com/default.aspx?scid=kb;EN-US;236621
although the kb is supposedly only for win2k, the following kb clearly state that the info applies to xp as well:
http://support.microsoft.com/default.aspx?scid=kb;en-us;818134&Product=winxp
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.
http://support.microsoft.com/default.aspx?scid=kb;en-us;315341&Product=winxp