We help IT Professionals succeed at work.

Change user name in "Documents and Settings"

wizard_99 asked
Medium Priority
Last Modified: 2011-08-18
How do I change a user name that's under "Documents and Settings"?

If I right click and select rename, windows does not allow that folder to be renamed, giving some "security" warning.

I've been to control panel , but that name does not show up under "users".

I'm running windows xp sp1.
Watch Question

change the name of the user account ..... the documents and settings name has to be the same as the user account name.....
hi wizard_99 ,

right click my computer
                 +local users and groups
                        +click on users
                              +right click on the user account you want to rename

each user account on the computer has a profile and that's the user profile....

what do you hope to accomplish....or better yet... why do you want to change the name?
Most Valuable Expert 2019
Most Valuable Expert 2018
the names under "Documents and settings" do NOT necessarily have to be the same as the user's name. The profile folders get created when a user logs on for the first time. This is the first possibility for a profile folder name to be different from the user's name.
Say you have a local account "Administrator", and you have logged on with it already. You join the machine to a domain, and logon with the *domain* account "Administrator". The domain account will (probably) create a profile folder named something like Administrator.domainname.
The second possibility: Renaming a user.
Let's stay with the above example and say that, for "security" reasons, the local Administrator's name was changed to "LocalAdmin", and a local dummy user "Administrator" was created. The LocalAdmin account will *still* use the profile folder "Administrator", and the dummy "Administrator" will get a profile folder with a name like "Administrator.001".
The profile folders are bound to the user's SID, not the user's name. The SID doesn't change when renaming a user name.

usually, there is absolutely no need to change a profile folder's name. If you want to know which user name actually uses which profile folder, you can logon with the user and check the environment variable %UserProfile% (do *NOT*, never, ever, use "C:\documents and settings\%username%" when accessing a profile, for example in a script).
The other possibility is a bit more complicated. Get PsGetSid from Sysinternals (http://www.sysinternals.com/ntw2k/freeware/psgetsid.shtml), then use that to retrieve the user's SID. Open regedit, go to HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList, check the SIDs listed there against the SID you're looking for, and then look at the value of "ProfileImagePath" (most of them will actually reflect the user's name, but as I said before, don't rely on that).
Now, to rename the folder while making sure that the user can still access the profile, do the following:
* Retrieve the user's SID.
* Logon with an administrator account (other than the user whose folder you want to change).
* Rename the folder to the user's current name (or whatever you want to name it).
* Open regedit, go to HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\<User's SID>, and change the "ProfileImagePath" to the new location.

How to Move the Location of a Locally Cached Profile

oBdA, you are so cool! Thanks a lot.
It was a great answer for Win NT, but left me unsure about Win XP. The answer said "Open regedit, go to HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" which implies it is for Win NT.  But the question was for Win XP, which I also have.  My registry does not have that key.
No the answer was not for Windows NT. Windows XP, 2000, and 2003 all also have the HKLM\SOFTWARE\Microsoft\Windows NT section.

Great answer. thanks, tom.