I recently had problems with installing PostgresSQL on my Win 7 x64 computer I tried many ways and in the end I was able to install the x64 version which didn't give me any access problem, but all the previous installations didn't install correctly and also didn't create any correct uninstall of the postgres, so I did some manual hacking to the registry to remove traces of previous installations and finally got Postgress Working only the latest version x64 worked. Anyway I wrongly deleted a few registry User Profiles under HK LOCAL MACHINE/Windows NT/Current Version/ProfileList.
This because the the previous PostgresSQL installers were creating multiple accounts as I did see also under C:\Users.
I also deleted those Postgres Account directories under C:\Users.
Restarted my computer and found out my desktop was not there anymore. The system created a new default Profile for my Administrator account called Administrator.NAMEOFMYCOMPUTER (It didn't delete the correct one though luckily), didn't like that so I decided to make a System Restore and recovered anything as it was before.
I manually deleted the extra (recovered) accounts under C:\Users and left only Administrator and the default Accounts. Installed postgres which created a default account postgres and now everything was fine beacuse I did manual registry hacking of only the things pertaining to postgres but excluding the ProfileList to avoid the error of generating a new default profile due to NTUser.dat inconsistency.
Now everything as I said was perfect but there was a but. Yesterday I had a hardware HD minor fail which led to a BSOD, the HD had surface errors. When I rebooted the PC I got asked if I wanted to repair Windows Startup or boot normally. I chose to boot normally and got a new bsod and the HD click sound. This time I got a bad System Config Blue Screen of Death.
I decided to repair startup, but during loading I got another HD click sound and BSOD.
I chose to shut down the PC, I switched all the power supply cables inside the PC Case and left the computer to rest for a night.
This morning I restarted the PC and did the repair, the system asked If I wanted to restore to a previous restore point, which I did. But It ended UP in restoring to the point where I was when the system created the new default profile Administrator.NAMEOFMYCOMPUTER for my Admin account.
So again the desktop was replaced and the Administrator account is simply pointing to the BAD c:\Users account dir.
I tried to make a system restore as I did earlier but it didn't work I got a 0x800149a (if I do remember that well) error. And so I'm stuck to the Administrator.NAMEOFMYCOMPUTER default profile.
The only way to make this correctly working is to Make the registry USERS, LOCAL MACHINE and CURRENT USER(probably not needed due to the fact it is a subset of USERS) registry hives with their references to point to my C:\Users\Administrator dir which maintains his integrity (still) instead of C:\Users\Administrator.NAMEOFMYCOMPUTER.
I created a new System Restore Point to avoid any problem after I hack the registry again
Now I tried this:
1)I exported as .REG files each of the hives
2)Using NOTEPAD++ I replaced every Path reference to C:\Users\Administrator.NAMEOFMYCOMPUTER to C:\Users\Administrator
3)I tried merging the REGS to the registry
Result: Didn't work cause I could not modify registry keys that were already under usage.
What I need then:
-I would need to merge the new registry informations from an outside OS to avoid this problem.
-I don't know how to do this !!!
I can export the current registry hives from regedit as binary images, but how do I modify them from outside the OS ?
I also can create backup of them using: ERUNT - The Emergency Recovery Utility NT
What I would need then is a tool to load up these registry hives in a virtual registry sandboxed environment which is fully writable, then I could patch this registry using the REGs I created or using another technique and then exporting back the hives as files so I can replace the files from another Operating System.
Any help to solve this is really appreciated,
P.S: In the meanwhile I ordered a new HD for backup to avoid any problem due to major HD Fail.