Windows 7 recreating user profile with profilename.domain or profilename.domain.000

After I did in-place repair of Windows 7 VM when I logged in, I found a new profile name was created adding domain(peter.lama.contoso) at the end. It would not log me in using the existing domain account(peter.lama).

Solution: Modify the profile list in registry:

Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList , go through each SID and find the ProfileImagePath Data containing perter.lama.contoso. Modify and replace the ProfileImagePath containing peter.lama.contso with peter.lama. Log out completely and log back it. Go to c:\users\ and delete the folder peter.lama.contoso to avoid any confusion. You should be good to go.