Windows 7 x64 %userprofile% and %username% are wrong

user-accountsuser-profileswindows 7

2 days ago my PC was fine, no issues. I turned my password off so I could send my PC in to my dad's office so he could plug it in and I could download stuff remotely from my phone (the office has a much faster line than I do). Yesterday when he came back home with it my PC was also fine, but after I set my user password again Windows Media Player seemed to reset its settings and ran the first time wizard again – that was the only thing out of the ordinary. Today I got home from college, booted my PC up and found a black background, aero was off, cleartype was off and none of my startup programs had started but all my documents, music and desktop items were there. Firefox is using the default profile, none of my apps remember any of my settings and keep using their first launch wizard.

I go digging around and find windows has kept my profile where it usually is, all my files are there so I couldn't understand what was going on. I tried %appdata% in run and windows tells me it can't find it. I googled and found one instance that kind of looked like my problem, but the thread was never answered and has been dormant for a couple months.

I then found %userprofile% is set to %systemroot%/System32/config/systemprofile. $username%=SYSTEM. Everything on google is about the user being logged in and being redirected to a temp profile, and the fix to that was deleting a user's registry key and using the .bak one instead. I don't have a .bak, and my user in HKLM/Microsoft/Windows NT/CurrentVersion/Profile List shows everything as normal.

What the hell is going on?

EDIT:

I made a new profile called Test, and changed my profile's ProfileImagePath in HKLM/Microsoft/Windows NT/CurrentVersion/Profile List to C:\Users\Test. Loggged out, logged back in and the profile works perfectly, but without my stuff. I then changed it back to my normal profile path and it was back to using the systemprofile. So there must be something in my user folder causing all of this.

EDIT 2:

Moved AppData into the Test folder and changed my profile again – all of my settings are there, I just need to move all my data over. I still don't understand how or why this happens. Are there any other folders that might cause a problem? Or is this just a case of windows being stupid again?

EDIT 3:

Turns out my NTUSER.DAT file is corrupt, because when I copy that file over to C:\Users\Test and load that folder with my account, it bugs out again, but if I delete it, %username% and %userprofile% get set correctly again.

Best Answer

I went fishing around the registry (guided by your post) and saw a folder with a .bak extension (indicating a backup file). I had never seen a folder in the registry with a .bak extension so I threw caution to the wind and deleted the ".bak" from the folder name (don't delete the folder - just modify the name to remove the .bak!), rebooted and my profile loaded successfully.

Since there was already another folder with the same name, I changed that first one (the default profile key) to -1000.

enter image description here

Related Question