Solved

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

Posted on 2004-05-02
6
1,203 Views
Last Modified: 2012-08-13
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
0
Comment
Question by:JimBsAs
6 Comments
 
LVL 34

Accepted Solution

by:
sramesh2k earned 320 total points
ID: 10971182
Jim,

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:

http://support.microsoft.com/default.aspx?kbid=319974
0
 
LVL 34

Expert Comment

by:sramesh2k
ID: 10971195
Additional note regarding Shell Folder, from my site!

Reset the Shell Folders paths to defaults:
http://www.mvps.org/sramesh2k/usershellfolders.htm
0
 
LVL 34

Expert Comment

by:sramesh2k
ID: 10971196
How to redirect Special folders in Windows XP:
http://www.mvps.org/sramesh2k/RedirectFolders.htm
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:JimBsAs
ID: 10971197
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.
0
 

Expert Comment

by:jplewis01
ID: 11271120
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
0
 

Expert Comment

by:sten_wolf
ID: 11708053
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
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Disclosure: Use this tutorial only when no other options helps to get Windows XP running without any problems and you don't want to format the drive. The back up of the data is the responsible of the user, however there is a description of how t…
Step by step guide to Clean and Sort your windows registry! Introduction: Always remember: A Clean registry = Better performance = Save your invaluable time In this article we're going to clear our registry manually! Yes, manually! The e…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question