FolderRisk: Caution
<utilisateur> C:\Users\<utilisateur>
C:\Users\<utilisateur>: an account's profile (%USERPROFILE%) with Desktop, Documents, Downloads, the NTUSER.DAT hive and the AppData folder.
What it’s for
Windows creates a profile folder for every account that signs in to the machine. Its path is %USERPROFILE%, that is %SystemDrive%\Users\%USERNAME%, and Microsoft calls it FOLDERID_Profile. The parent folder of profiles is normally C:\Users (the ProfilesDirectory setting). For a Microsoft account, the folder name uses the first five characters of the email address, not the display name. In this page, <utilisateur> stands for the account name.
What it contains
- The personal folders:
Desktop,Documents,Downloads,Pictures,Music,Videos. AppData(hidden) withLocal,LocalLowandRoaming, where applications keep their data.NTUSER.DAT, the user’s Registry hive (HKEY_CURRENT_USER).- Depending on the version, compatibility junctions (
Application Data,Local Settings…).
Risks and best practices
- Renaming the folder breaks the profile, because the path stored in the Registry does not follow. To change a name, create a new profile and migrate the data.
- To delete a profile, use Advanced System Settings > User Profiles, or
Win32_UserProfile. Deleted from File Explorer, it leaves its Registry key and SID behind. - Back up or redirect
DocumentsandDesktop(OneDrive, folder redirection) before any cleanup. - On a shared machine or an RDS server, watch profile sizes: profiles are what fills the disk.
Useful commands
# Profiles registered on the machine, oldest firstGet-CimInstance Win32_UserProfile | Where-Object { -not $_.Special } | Sort-Object LastUseTime | Select-Object LocalPath, LastUseTime, SID
# Size of a profile (may take a long time)Get-ChildItem $env:USERPROFILE -Recurse -Force -ErrorAction SilentlyContinue | Measure-Object -Property Length -Sum
# Cleanly remove an unused profile (simulation; replace the path)Get-CimInstance Win32_UserProfile | Where-Object LocalPath -eq 'C:\Users\olduser' | Remove-CimInstance -WhatIfFolder contents
Folders 4
- AppDataHidden profile folder where applications keep per-user data, in three branches: Local…
- DesktopUser Desktop folder: files and shortcuts shown on the desktop; can be redirected to…
- DocumentsUser Documents folder: default location for personal documents; can be redirected to…
- DownloadsUser Downloads folder: default location of files downloaded by browsers; content that…