FolderRisk: Do not touch
config C:\Windows\System32\config
Registry hives (SAM, SECURITY, SOFTWARE, SYSTEM, DEFAULT) and their .LOG and .sav files: the system's configuration database.
What it’s for
C:\Windows\System32\config holds the on-disk files of the Registry hives, that is the system’s configuration database. Microsoft states that most hive supporting files are here and that they are updated at each user logon. This page carries the rules common to all hives. Each hive then has its own page for what sets it apart.
What it contains
SAM: local accounts and password hashes (HKLM\SAM).SECURITY: local security policy (HKLM\Security).SOFTWARE: software and Windows configuration (HKLM\Software).SYSTEM: hardware, drivers and services (HKLM\System), with an.altbackup copy on versions that support it.DEFAULT: theHKEY_USERS\.DEFAULThive.COMPONENTSandDRIVERS, two more hives in the folder.- Associated files:
.LOG(transaction log) and.sav(backup copy of a hive). - The
RegBacksubfolder, which has no longer been populated by default since Windows 10 version 1803 (see its page).
User hives are elsewhere: NTUSER.DAT at the root of the profile, UsrClass.dat in AppData\Local\Microsoft\Windows.
Risks and best practices
- These files are locked while Windows runs. Move, rename or delete them offline and the system may no longer boot. To get a copy, use
reg saveor a system backup. - To change a value, work on the key with
regedit,regor PowerShell, never on the file. - An offline copy of the
SAMandSYSTEMhives is enough to extract local password hashes. Protect physical access, encrypt the disk and watch your backups.
Useful commands
# Hives and companion files (read access limited to administrators)Get-ChildItem -Force "$env:windir\System32\config" -File | Select-Object Name, Length, LastWriteTime
# Offline copy of a hive (as administrator)reg save HKLM\SYSTEM C:\Temp\system.hiv
# Read the Registry without touching the filesreg query HKLM\SYSTEM\CurrentControlSet\Services /s /v ImagePathFolder contents
Folders 2
Files 5
- DEFAULTThe DEFAULT hive, exposed as HKEY_USERS\.DEFAULT: the SYSTEM account profile, used before…
- SAMSAM: the HKLM\SAM Registry hive, the database of local accounts and groups and their…
- SECURITYRegistry hive HKLM\SECURITY: local security policy, LSA secrets and cached credentials…
- SOFTWARERegistry hive HKLM\SOFTWARE: Windows and application settings that apply to all users of…
- SYSTEMRegistry hive HKLM\SYSTEM: control sets, services, drivers and hardware configuration…