Friday, 5 February 2010

Recovering from a bad Windows profile

Sometimes, Windows XP loses the user's profile and goes with a temporary profile instead which is just that, temporary. Any changes made to that profile -- like Outlook settings -- are lost with the next logout.

Here is a simple ten step process to get the profile back.

0. Reboot the computer. You'll see why in a minute.

1. Log in with Administrative priveleges (domain or local). If you're trying to recover your own profile and your own logon has admin priveleges, you need to take the longer route. You need to log in as somebody else than you're trying to restore. [0]

2. With Windows Explorer, navigate to C:Documents and Settings. From View » Options » Advanced [1], set the appropriate option to show hidden files and folders.

3. Make a backup copy the Problematic user's directory under Documents and Settings -- for this discussion, we shall call it C:Documents and SettingsProblematic or Problematic for short -- just in case. This is why you needed to reboot; if the user has been logged in since the last boot, there will be some files locked inside the Problematic directory.

4. Tricky time. Rename the hidden (and now made-visible) directory Default User into Default User Original. Rename the Problematic directory to Default User. [2]

5. Log out Administrator and ask Problematic to log in. Since Problematic does not have a profile, a new one is created using the data from Default User. This is not just magical, but doubly so, as the bad data isn't copied verbatim but used as profile fodder to create a new and altogether less Problematic user profile!

6. Log out Problematic (who know for the discussion really should be called something else :) and log in as an administrator.

7. Delete the "Problematic" Default User directory. Rename the Default User Original into Default User.

8. Log out. Feel smug.

OK, that was only nine steps so keep one in store for your next sysadmin magick. We both know you will both use and need it.

[0] In short, the longer router involves creating a new user and granting that user admin privs.
[1] OK, that isn't the exact path, but you'll find it. It's the second rightmost menu. I don't have an XP handy at the moment.
[2] You could probably achieve the same thing right clicking My computer > Properties > ... > User profiles and removing the offending profile, but this method includes recovering the b0rken profile itself. Do this for extra karma.