Windows Temporary Profile Fix: Stop the Login Loop
In this article
Windows creates a temporary profile when it cannot access your user profile folder during login, usually due to a corrupted registry key or a locked file. To fix this, you must edit the Windows Registry to remove the corrupted profile reference and point the system back to the correct user folder. This process restores access to your personal files, desktop settings, and app data without requiring a full system reinstall.
What You'll Need
- An administrator account on the PC (if your main account is stuck in a temporary profile, you may need to enable the built-in Administrator account or use another admin account).
- A backup of your important files (though this process doesn't delete files, editing the registry always carries a small risk).
- Basic familiarity with navigating the Windows folder structure.
Step-by-Step
Note: Menu labels and paths may differ slightly depending on your version of Windows, your region, or specific system updates.
- Create a System Restore Point: Before touching the registry, search for "Create a restore point" in the Start menu. Select your system drive, click "Configure," ensure "Turn on system protection" is selected, and click "Create." This ensures you can revert the system if a mistake is made.
- Identify your Security Identifier (SID): Since the registry uses long strings of numbers (SIDs) rather than usernames, you need to find yours. Open the Command Prompt (cmd) as an administrator. Type
whoami /userand press Enter. Copy the long string of characters under the "SID" column. Keep this window open or write the code down. - Open the Registry Editor: Press the Windows Key + R on your keyboard, type
regeditin the Run box, and press Enter. If prompted by User Account Control, click Yes to allow the app to make changes. - Navigate to the Profile List: In the left-hand sidebar of the Registry Editor, navigate through the following folders:
HKEY_LOCAL_MACHINE > SOFTWARE > Microsoft > Windows NT > CurrentVersion > ProfileList. - Locate the Corrupted Profile: Under the "ProfileList" folder, you will see several folders starting with "S-1-5". Look for the folder that matches the SID you found in Step 2. You will likely see two folders with the same SID, but one will end with
.bak(e.g., S-1-5-21... and S-1-5-21....bak). - Handle the .bak Extension: The folder without the .bak extension is the temporary profile Windows is currently using. The folder with the .bak extension is your actual, original profile. To swap them:
- Right-click the folder without .bak and rename it by adding
.oldto the end. - Right-click the folder with
.bakand rename it by removing the.bakpart entirely.
- Right-click the folder without .bak and rename it by adding
- Reset the Profile State: Now, click on the folder you just renamed (the one that no longer has .bak). In the right-hand pane, look for a value named
State. Double-click it and change the "Value data" to0. If you see a value namedRefCount, double-click it and change its value to0as well. - Verify the Profile Path: While still in that folder, check the
ProfileImagePathvalue. Ensure the path listed (e.g., C:\Users\YourName) correctly points to your actual user folder on the hard drive. If it points to a folder called "TEMP", double-click it and manually type the correct path to your user folder. - Restart the Computer: Close the Registry Editor and restart your PC. Do not just sign out; perform a full restart to ensure the registry changes are initialized during the boot sequence.
Common Mistakes
One of the most frequent errors is editing the wrong SID. Because the list in the registry can be long, users often change the values of the system's default profiles (S-1-5-18, 19, or 20) instead of their own user account. Always verify the SID using the whoami /user command before making changes.
Another common mistake is failing to change the "State" value to 0. Even if you rename the .bak folder correctly, Windows may continue to trigger a temporary profile if the State value indicates that the profile is still "dirty" or in the process of being loaded. Both State and RefCount must be zeroed out for a clean login.
Some users attempt to simply delete the temporary profile folder from the C:\Users directory. This does not solve the problem because the issue is not the folder itself, but the registry pointer that tells Windows which folder to load. Deleting the folder without fixing the registry will often result in the same error on the next reboot.
Tips
To prevent this from happening in the future, avoid shutting down your computer by holding the physical power button while Windows is still running. Sudden power losses during the profile write-process are the leading cause of profile corruption.
If you use third-party antivirus software, ensure it is updated. Some aggressive security suites can lock the ntuser.dat file (the file that stores your user settings) during the login process. If the system cannot lock this file, it defaults to a temporary profile. If this happens frequently, try disabling the antivirus temporarily to see if the login loop stops.
Always check your disk health using the chkdsk command if you experience repeated profile corruption. A failing hard drive or SSD can cause sectors of your profile to become unreadable, forcing Windows to create a temporary environment to allow you to access the desktop.
Troubleshooting
If the registry fix does not work and you are still logged into a temporary profile, the corruption may be too severe to repair. The safest and most effective alternative is to create a brand new administrator account.
To do this, go to Settings > Accounts > Other users > Add account. Select "I don't have this person's sign-in information" and then "Add a user without a Microsoft account." Once the account is created, change the account type to "Administrator." After logging into the new account, you can navigate to C:\Users\OldUserName and manually copy your Documents, Pictures, and Downloads into the new user's folders. This bypasses the corrupted registry keys entirely.
If you cannot access the Settings menu because you are in a temporary profile with restricted permissions, you can enable the hidden Administrator account. Open Command Prompt as an administrator and type net user administrator /active:yes. Restart the PC, log into the account named "Administrator," and then perform the registry fix or create a new user account from there. Once finished, disable the hidden account by typing net user administrator /active:no.
Frequently Asked Questions
Will I lose my files if I'm in a temporary profile?
No, your files are not deleted. They are still located in your original user folder (C:\Users\YourName). However, any files you save while logged into the temporary profile will be deleted as soon as you log out or restart.
Why does Windows create a temporary profile in the first place?
Windows does this as a safety measure. If the system detects that your user profile is corrupted or that the ntuser.dat file is locked by another process, it creates a blank temporary profile so you can still boot the computer and rescue your data rather than being locked out of the system entirely.
Can a Windows Update cause this issue?
Yes, occasionally a failed or interrupted update can leave the registry in an inconsistent state or lock profile files during the reboot process, leading to the temporary profile loop.
Is it safe to delete the .bak folder in the registry?
You should not delete it until you have successfully logged into your original profile and verified that everything is working. The .bak folder is your only link to your original settings; if you delete it before fixing the path, you may have to create a new user account from scratch.
How do I know if my profile is actually temporary?
You will usually see a notification in the bottom right corner of the screen stating, "You have been logged on with a temporary profile." Additionally, your desktop wallpaper will be reset to default, and your personal files will be missing from the desktop and documents folders.