I restored a PC from backup using the ntbackup utility. I restored all programs and content on the C:\ including the windows directory and program files. I also restored the systemstate meaning I restored the registry, all user accounts, drivers etc.
However I did not restore the profiles!
I could log in fine with a standard user account. However my profile settings did not save. Also when I ran a VB Script I got the following error:
Loading your settings failed. (Access is denied.)
I went into the registry and saw that my HKCU for that user was only read only for all users. My user account did not have ownership and "Full Control" of the entire HKCU key and all sub keys.
This was a hard problem as I couldn't exactly run regedit.exe as Administrator as then it would show me the HKCU for the Administrator account. HKCU is the ntuser.dat file in the users profile directory. It is registry settings unique to that user profile... so when you open regedit it will only display the HKCU settings for that user's ntuser.dat file!
The way I fixed this was I added that user into the "Administrators" group. I then went in and took ownership of the HKCU key and all sub keys. Then took full control. I then removed the user from the "Administrators" group.