Pcornel
Windows

Registry

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

Back to the Topic

Answer

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.

Remember

  • 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.

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
  • Get-ChildItem 'HKLM:\SYSTEM\CurrentControlSet\Services' — example: services keys

Commands

regedit
Open the Registry Editor.
reg.exe
Read and change the registry from the command line.

Verify in this order

hive file loaded → root key → subkeys → values with type and data → consumer reads them

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.

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

Confirmation

Confirm action

Continue?