Eventually, for one reason or another, you’re likely to encounter a corrupted user profile. Â While it’s possible to simply perform a System Restore to correct this in many cases, other times, that isn’t possible.
Fortunately, there are ways around this problem. Â For starters, it’s important to know that Windows stores all user profile information in the following location:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList
Here, you’ll find several subkeys named S-1-5-xx-…, each of which corresponds with a specific user on the machine. Â How do you know which user is which? Â By noting the value of ProfileImagePath, which contains the path to the user’s home directory (and the value of the %USERPROFILE% Environment Variable). Â If this value happens to be corrupt, this value may be incorrect, instead pointing to, for instance, the Windows temp directory. Â You can change this value to the proper one if you’re careful about what you’re doing and it may correct the issue.
But before you change anything, first be sure you have a safety net just in case.  If you can log in with another user profile, do so, then create a System Restore point.  Or, at the very least, boot to Safe Mode (or to Startup Repair/WinRE in Vista/7) and create a backup of the registry hives (either by exporting them from within Regedit or by copying them directly from the system32/config and %USERPROFILE% directories of the affected users.  Remember, the names of the registry hives are SOFTWARE, SYSTEM, SAM, SECURITY, and  DEFAULT in the config folder and NTUSER.dat in the %USERPROFILE% folder).
Other things to check include:
- Look for SIDs (S-1-5-…) that end in “.bak”
- If you see one, rename the other corresponding SID (which matches) to something else for backup purposes (such as .old)
- Then, remove the “.bak” from the end of the other matching SID and check the RefCount value before rebooting:
- Look for RefCount values above 1 (You can change this to 0)
If things are really screwy, you can export the entire ProfileList key and then manually delete any SIDs that you don’t want. Â (This is what I had to do to force my client’s PC to boot properly after some seriously registry cleaner/tweak utility damage yesterday.) Â Just be sure that you actually have backups of the data before you do so!
Play around with this key and you’ll eventually find your way back in Windows without (hopefully) too much trouble. Â In the absolute worst-case scenario, you may need to enable Administrator account access and then create another replacement user account (SID) for yourself, after which you’ll need to copy all of the files over manually. Â But don’t fret; remember, there’s always a solution!