guide · static export
PC · profile

Repair a Corrupted User Profile Without Losing Your Files

A profile that loads as a temporary desktop is a broken registry entry, not lost data. Fix the ProfileList key, build a clean profile and copy the data across.

by@guidox updated:10/31/26 time:35 min level:Advanced tested on:Windows 11 24H2 works on:Windows 10, Windows 11 tools:Registry Editor, A second admin account
TL;DR

Confirm the machine is loading a **temporary profile**, repair the **ProfileList** registry key for that SID, and copy the data into a fresh profile with **robocopy** while leaving **NTUSER.DAT** behind.

Before you start

Requirements

  • A second administrator account
  • Admin rights
  • 35 minutes
  • Free space for a profile copy
Step by step

Instructions

01

Confirm it is a temporary profile

Windows names the session when the real profile cannot load. A folder under **C:\Users\TEMP** or a TEMP-prefixed profile in the list is the proof, not a slow sign-in.

Get-CimInstance Win32_UserProfile | Select-Object LocalPath,SID,Special,Loaded,LastUseTime
dir C:\Users
tipTake a screenshot of the error. The message differs between a lost profile and a failed registry hive, and they need different fixes.
02

Sign out of every session using that profile

The hive must be unloaded before you touch it. Sign out, and confirm that no process still holds NTUSER.DAT before you rename anything.

query user
Get-Process | Where-Object { $_.Path -like 'C:\Users\ana\*' } | Select-Object Id,Name
03

Read the ProfileList entry for the SID

Windows keeps one key per SID. **State** with bit 0x8000 set or a **.bak** suffix marks the broken entry that has to be repaired.

Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList' |
  ForEach-Object {
    $p = Get-ItemProperty $_.PSPath
    [pscustomobject]@{ SID = $_.PSChildName; Path = $p.ProfileImagePath; State = $p.State; RefCount = $p.RefCount }
  } | Format-Table -AutoSize
04

Repair or rename the broken key

If a **.bak** key exists next to the real one, delete the broken key and drop the suffix from the backup. If not, set **State** and **RefCount** to 0 so Windows tries the original path again.

reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\S-1-5-21-0000000000-0000000000-0000000000-1001" /v State
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\S-1-5-21-0000000000-0000000000-0000000000-1001" /v State /t REG_DWORD /d 0 /f
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\S-1-5-21-0000000000-0000000000-0000000000-1001" /v RefCount /t REG_DWORD /d 0 /f
⚠ warningExport the ProfileList key first with reg export. A wrong SID here turns a repairable profile into a login loop.
05

Create a clean profile and copy the data

Sign in with the account and let Windows build the profile. Copy documents, pictures and project folders from the old directory, excluding the registry hive and the caches that would carry the corruption over.

robocopy C:\Users\ana.old C:\Users\ana /E /COPY:DAT /R:1 /W:1 /XD AppData "Application Data" Cookies "Local Settings" NetHood PrintHood Recent SendTo Templates /XF NTUSER.DAT* ntuser.ini
tipCopy settings selectively afterwards: the browser profile and app configs live under AppData and can be restored folder by folder.
06

Verify the profile is permanent

Sign out and in twice. The path must stay the same, the TEMP entry must be gone from the ProfileList, and no temporary-profile banner may appear.

[Environment]::GetFolderPath('UserProfile')
Get-CimInstance Win32_UserProfile | Where-Object { $_.LocalPath -like '*TEMP*' } | Select-Object LocalPath,SID
⚠ warningKeep the old folder until everything works. Renaming it back is only possible while the new profile has not taken over its path.
Troubleshooting

Common issues

The profile is already a TEMP one in ProfileList

Delete the TEMP entry for that SID, keep only the real path, and sign in again. The temporary entry is what makes Windows reuse the temp folder.

Windows logs in to a temp profile again after the fix

The hive itself is damaged. Rename C:\Users\<user> to <user>.old, let Windows create a fresh profile, and copy the data in.

Access denied when opening the old folder

Take ownership first with takeown /f C:\Users\ana.old /r /a and then grant yourself access, or copy from an elevated session.

The SID does not match the account

Read the SID from the account, not from memory: Get-LocalUser and the ProfileList entry have to name the same value.

FAQ

Frequently asked

Are my files lost?

No. The profile failed to load; the files under C:\Users are still there. Only the registry hive is broken, and that holds settings, not documents.

Should I delete the old profile in Settings?

Only after the new one worked for a week. Deleting it removes the folder too, and that is your fallback copy.

How to undo this

Rename the new profile folder, restore the exported ProfileList key with reg import, and restore the old folder name. Sign in once to confirm the original path loads again.

Changelog · 1 entry
  1. 2026-10-31
    First version
Interactive version: checklist, feedback, related guides →

Free · no account needed · tracks your progress