Pcornel
Windows · Windows Fundamentals

Windows Registry

Cheat sheet · https://pcornel.dk/topic.php?topic=2935

Back to the Topic

Answer

The Windows Registry is a hierarchical database used by Windows, services and applications to store configuration and state. Data is organized into keys/subkeys and named values beneath root-key views such as HKEY_LOCAL_MACHINE (HKLM), HKEY_CURRENT_USER (HKCU) and HKEY_USERS (HKU).

Remember

  • A key is a container/node; a value is a named data entry stored under a key.
  • HKCU is a view of the currently loaded user profile hive under HKU.
  • HKCR is a merged compatibility view related to class/file-association registration rather than an independent ordinary hive file.
  • Registry values can be strings, expandable strings, integers, multi-strings or binary data.
  • 32-bit and 64-bit processes can see different Registry views for redirected locations.
  • Stored configuration does not prove a service/application has reread or accepted it.

First checks

  • Get-ItemProperty 'HKLM:\<path>' — read values
  • reg query <key> /s — query in CMD
  • reg export <key> <file>.reg — back up a key
  • Get-Acl 'HKLM:\<path>' | fl — key permissions

Verify in this order

setting → hive → key → value (type and data) → read by Windows or the application

Where it usually breaks

First mismatch in target identity/version → persistent configuration/source of truth → provider/service/control plane → runtime/effective state → user/workload-visible result → event/log evidence; preserve identity/native error/pre-state before mutation.

Registry root-key quick reference

RootTypical meaningImportant boundary
HKLMmachine-wide system/software configurationapplies by key semantics; not every process rereads live
HKCUcurrent user’s profile-backed configuration viewdepends on the user context
HKUloaded user profile hivesincludes multiple user/security contexts
HKCRmerged class/association registration viewcompatibility/merge semantics matter
HKCCcurrent hardware-profile viewnot a generic machine configuration root

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2935

Confirmation

Confirm action

Continue?