Link to home
Start Free TrialLog in
Avatar of mmahelpdesk
mmahelpdesk

asked on

Suggesstions for Default User ntuser.dat file editiing.

I have an issue when I edit the default user profile and I was hoping to get some advice on how to go about correcting my problem or suggestions on new ways to edit the ntuser.dat file itself. I normally go about editing the default user profile by logging in as a normal user, making changes to the account profile as needed and then using the User Account "Copy To" function to make the editing account profile my new default user profile. This works fine with things related to the profile such as folder structure and icons, but my trouble is with the ntuser.dat file. Some of the user specific information, such as all of the folder paths in the HKEY_LOCAL_MACHINE\NTUSER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders key are all routing to the normal user I logged in as.

For example, I log in as Wanda Forte and mess with the profile. Then I log in as an admin and use the Copy To function to make Wanda's profile the new Default User profile on the machine. But now, when I log in as Joe Shoe, my "My Documents" folder points to C:\Documents and Settings\Wanda.Forte\My Documents!!!

Is there a better way to edit the ntuser.dat file? The rest of the profile works great when I copy it, but its the darn things like this that screw it all up. This is beginning to really frustrate me. I'll completely do this a different way if I have to, any suggestions would greatly be appreciated. My goal is to find a way to make changes on the ntuser.dat file while keeping all settings generalized. I know my way around regedit enough to make slight changes but I can't create an entire default profile in regedit alone.

Thanks for your suggestions and advice in advance.
Avatar of johnb6767
johnb6767
Flag of United States of America image

Command shell overview
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds_shelloverview.mspx?mfr=true

Look for the section titled....

"Using environment variables with Cmd.exe"

They can be used in the registry as well....
And why would you alter the default user profile, that only affects newly created accounts. Are you trying to restore functionality to your own profile? Or adjust for future users?
Avatar of mmahelpdesk
mmahelpdesk

ASKER

Oh if it were that easy and I could simply use %username% in its place. You won't believe this, but if I use %username% in that particular key, making it: C:\Documents and Settings\%username%\My Documents it will actually create a folder called %username%. Go figure.

I'm creating a default user profile with customized settings for an image that I'll be pushing to all of my users at work. We re-route personal drives to network shares and add\remove things from their setup so when we ship out PCs to our users it will look the same across the board for whoever logs in.
A Default Profile isnt even needed for Folder redirection, it should be done at the GPO level.

And possibly some keys wont accept %VARIABLES%, but without knowing what keys you are trying to maniuplate, it will be hard to do....

Are you on a domain?

And is it HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders that you are trying work with?

You might also look at %USERPROFILE%, which takes you all the way to C:\Documents and Settings\USERID.
I think were getting a little more specific than we need to be when trying to troubleshoot this. My original issue is that when I set up default user profiles the way I do it brings over account specific information in the ntuser.dat file.

We are on a domain, yes. And we are working in HKLM. I am actually having an issue with this because on the GPO level, we have set it to redirect to \\servername\users\home\%USERPROFILE%\My Documents but because of the way I setup the default user profile the computer thinks the person that just logged in is actuallty the user account that I used to create the default user profile and not the actual account that I logged in. i.e, %USERPOFILE% is the account that I used to create the default user profile and not the person that just logged in so no matter who logs in, it will always be wrong.

But this is just one instance of something that is messed up because of the way that I edit the default user profile. There are many others, so rather than figure out how to fix them individually I was hoping to get advice on how to go about changing settings in a default user profile account correctly so as I don't run into things like this alltogether.
I'm sorry we are not working in HKLM, I'm actually talking about the ntuser.dat file in the Default User profile. In order to actually view its contents and see the problems I load the hive by first highlighting HKLM, my confusion and apologies.
ASKER CERTIFIED SOLUTION
Avatar of johnb6767
johnb6767
Flag of United States of America 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
Yes I have read that document and thats how I first started, however the Copy To function still brings over the ntuser.dat file along with some user specific information. Oh well. I guess I'll have to play with it. Thanks for your help.
Not only does it bring over the .dat file, but the rest of the profile as well, like custom favorites, desktop, appdata etc....
Yeah I'm aware of that, and thats how I customize that sort of thing. But if I want my users to only be able to view the classic start menu and things like that then I need to edit that ntuser.dat file.
Correct. I just prefer doing the whole customizations while IN the DU profile, instead of the registry. More of a personal preference....
As do I, I know what my users are going to get when i'm looking at exactly what changes I made. But its my examples in my previous posts that ruin customizing it like this.
We have a situation where we modify about 3% of our standard systems to change the default background color. This is the cmd script I use to do that:

reg load HKU\TempHive "c:\Documents and Settings\Default User\ntuser.dat"
reg add "HKEY_USERS\TempHive\Control Panel\Colors" /v Background /d "255 0 0" /f
reg save HKU\TempHive "c:\Documents and Settings\Default User\ntuser.dat"
reg unload HKU\TempHive

You could pretty much change everything else in the hive if you needed to. . .