Changing a username in 7

Man of Honour
Joined
17 Oct 2002
Posts
160,199
Hi guys,

Installed 7 the other day, miskeyed the username. Irriating, but Windows had an option to simply 'change username'. Which I did, now its correct.

Problem is all the folders etc on the machine - ie, the Users folder - have the old username still.

How can I change all these?
 
backup any files in the folder. then logon with another admin account and delete the folder. then log back on again with the renamed account and a folder with the correct name will be created.
 
i found this online, however i cant check it as i only have 1 domain user account on my windows 7 machine.. worth a punt though. you may need to log in as the admin account first though probably?

1. Click Start and click Control Panel.
2. Open User Accounts.
3. Click the Change your account name option. If you want to rename another user account, click the Manage another account option and select the account you want to rename.
4. Type in the new account name within the New account name field.
5. Click the Change Name button.
 
i found this online, however i cant check it as i only have 1 domain user account on my windows 7 machine.. worth a punt though. you may need to log in as the admin account first though probably?

1. Click Start and click Control Panel.
2. Open User Accounts.
3. Click the Change your account name option. If you want to rename another user account, click the Manage another account option and select the account you want to rename.
4. Type in the new account name within the New account name field.
5. Click the Change Name button.

That's what he's already done but it's left the users Profiles and User Documents named as previous.

There isn't an easy way of doing this but if you login as admin, run up RegEdit and then locate the following key in the registry:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList

Within this key locate the entry for the user you want to rename, then alter ProfileImagePath so that it's correct.

Then highlight

HKEY_USERS

then within the File menu select Load Hive, then browse to C:\Users locate the user folder and within that select the file NTUSER.DAT, give it a name when prompted.

Now within

HKEY_USERS\<name that you gave>\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders

and

HKEY_USERS\<name that you gave>\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders

Find all occurrences of the previous name and change.

When you finished the above highlight

HKEY_USERS\<name that you gave>

and from the File menu select Unload Hive

Now rename the actual folder that's incorrect, I normally then do a reboot and then login as the user and hope :)

Or you could do as pointed out above, make a backup of all the important files/folders, delete the incorrectly named folder, delete and re-create the user, then login and finally do a restore of the files backed up.
 
backup any files in the folder. then logon with another admin account and delete the folder. then log back on again with the renamed account and a folder with the correct name will be created.

I would only restore files you put into your profile - docs, pictures, videos, downloads etc. Perhaps backup your browser profiles etc.

Moving some of the profile-specific files around will cause problems - I did something similar where I accidentally nuked the User folder for my profile [don't ask :p], it was recreated by Windows 7 and I thought "meh, it'll be fine". Dumped a backup in place of the new User folder and restarted. Windows didn't like it and reverted to a temporary profile folder.

If it is a pretty fresh install of Windows I would just create a whole new account with the correct name as asim suggested. Then chuck your docs etc back where you want them.
 
Back
Top Bottom