Solved

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

Posted on 2004-05-02
6
1,200 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Xpmode vms all have same IP address. Not using Nat. 6 109
Old version of iTunes download 4 119
how to Repair Windows XP 12 88
Task with PowerShell Script is failing with 0x41301 7 85
Issue: Unstable cursor in Windows XP and Windows runs extremely slow in that any click will bring up the Hour glass (sometimes for several seconds before giving you what you want) . Troubleshooting Process and the FINAL FIX: This issue see…
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

919 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now