Use this when reading or changing Windows settings stored in the registry.
Registry
The Windows registry is a hierarchical database of system, application and user settings, organized in hives and keys under roots like HKLM and HKCU. Edit it with regedit, reg.exe or PowerShell, and back it up first.
1. Identify the key path and value name (and type: REG_SZ, DWORD …).
2. Back up: reg export <key> backup.reg.
3. Read with Get-ItemProperty; check permissions with Get-Acl.
4. Change via GPO/tool if possible; otherwise Set-ItemProperty.
5. Confirm effect; restore from the .reg if wrong.
hive file loaded → root key → subkeys → values with type and data → consumer reads them
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
regeditPrimary Commands
Configuration and operational commands for this Topic.
Subtopics
Go one level deeper into this subject.
The registry architecture consists of root keys that map onto hive files on disk, containing nested keys with typed values.
Subtopic HKEY_LOCAL_MACHINEHKEY_LOCAL_MACHINE (HKLM) holds machine-wide configuration: hardware, drivers, services, installed software and security settings, stored in the SYSTEM, SOFTWARE, SAM and SECURITY hives.
Subtopic HKEY_CURRENT_USERHKEY_CURRENT_USER (HKCU) holds the logged-on user's settings, such as desktop, environment variables and application preferences.
Subtopic HKEY_CLASSES_ROOTHKEY_CLASSES_ROOT (HKCR) holds file associations and COM class registrations.
Subtopic HKEY_USERSHKEY_USERS (HKU) contains the loaded profiles of all users on the machine, keyed by SID, plus .DEFAULT for the system account.
Subtopic Registry HivesRegistry hives are the files that store registry data: SYSTEM, SOFTWARE, SAM, SECURITY and DEFAULT in C:\Windows\System32\config, plus NTUSER.DAT and UsrClass.dat in each user profile.
Subtopic Registry KeysRegistry keys are containers in the registry tree, like folders, addressed by paths such as HKLM\SYSTEM\CurrentControlSet\Services.
Subtopic Registry ValuesRegistry values are named data entries inside keys, with types such as REG_SZ (string), REG_DWORD (32-bit number), REG_MULTI_SZ, REG_EXPAND_SZ and REG_BINARY.
Subtopic Registry TroubleshootingTroubleshoot the registry by exporting keys before changes (reg export), checking permissions on keys, using Process Monitor to see which keys an app reads, and restoring hives from backup or RegBack if Windows cannot start.
- Export the key with reg export before you change anything.
- HKCU is per user, HKLM is machine-wide.
- A Group Policy value overwrites your manual change at next refresh.
Get-ItemProperty 'HKLM:\<path>'— read valuesreg query <key> /s— query in CMDreg export <key> <file>.reg— back up a keyGet-Acl 'HKLM:\<path>' | fl— key permissionsGet-ChildItem 'HKLM:\SYSTEM\CurrentControlSet\Services'— example: services keys
ReferenceImportant terms & boundaries2 sections · depth on demand
Root keys
| Key | Contains |
|---|---|
| HKLM | Machine-wide settings |
| HKCU | Current user (from HKU\SID) |
| HKCR | File associations/COM (merged view) |
| HKU | All loaded user profiles |
| HKCC | Current hardware profile |
In depth
The registry is Windows' hierarchical configuration database: keys (like folders) contain values (name, type, data). Root keys are views onto hive files loaded from disk.
Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' | Select ProductName,DisplayVersion,CurrentBuild
reg query "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters"
reg export HKCU\Software\MyApp myapp-backup.reg
Change settings through Group Policy, Intune or documented tools where possible; direct registry edits are hard to track and easy to get wrong.
ReferenceConfiguration & state1 section · depth on demand
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Registry. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://learn.microsoft.com/en-us/windows/win32/sysinfo/registry · confidence 94%