This behavior occurs because Windows automatically closes any registry handle to a user profile that is left open by an application. Windows Vista does this when Windows Vista tries to close a user profile.
In versions of the Windows operating system that are earlier than Windows Vista or Windows 7, you must install the User Profile Hive Cleanup Service (UPHClean) utility to have the same functionality. However, the UPHClean utility is incompatible with Windows Vista and Windows 7. Additionally, the UPHClean utility is not needed because this functionality is built into Windows Vista.
http://support.microsoft.com/kb/947238
You may try performing aClean Boot to check if any security software is not letting windows to close the registry key.
To help troubleshoot error messages and other issues, you can start Windows 7 by using a minimal set of drivers and startup programs. This kind of startup is known as a "clean boot." A clean boot helps eliminate software conflicts.
How to troubleshoot a problem by performing a clean boot in Windows 7:
http://support.microsoft.com/kb/929135
Also, see the section on how to return your computer to a Normal startup mode by following the steps under “Reset the computer to start as usual.