Our thinking


Can’t log in to Windows after deleting user profile folder in /Users

I recently had a client who when they gave me the login details to set up a new user for them, they had a typo in that person’s first name. As their email addresses followed the pattern [email protected], I also had to change their email address, and their username.

This person had already been set up on a Windows laptop and signed in via Entra ID. I didn’t want to change all the individual apps over to the new login, and wanted to make sure that everything was using the new login.

What I did was delete the user profile folder in /Users.

This however caused a bit of a problem with Windows still knowing about the user profile, and not simply recreating a new folder on initial login. The symptom was that when the user logged in, they got an empty desktop and a warning message saying that any changes they made while logged in wouldn’t be saved.

I initially thought that it should be a quick fix to use Delprof2 – User Profile Deletion Tool and delete the profile from the Registry, however due to the order in which I did things, this didn’t end up working for me.

As it turned out, I had to jump into the Registry with good ol’ regedit and remove the old profile myself.

Looking in HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList gave me a list of keys, by clicking on each one I could see what Windows thought was the path to the home folder (and therefore see what the username was). By deleting the old profile key from the Registry, I was then able to successfully log in as the “new” user, Windows created a new home folder as expected, and then I could sign in to Outlook, OneDrive, Teams etc with no further difficulties.

Sometimes you may have success with deleting the profile with the old control panel, via running rundll32.exe sysdm.cpl ,EditUserProfiles from Start > Run, however in many cases, this doesn’t show profiles for Entra ID users.

As always, be careful what you do in the registry, you can easily break things in unusual and exciting ways, and if you break your own computer, then that’s on you, not me.

Leave a Reply