Pcornel
Windows · Registry

Registry Values

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

Back to the Topic

Answer

Registry 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. Set them with reg add or Set-ItemProperty.

Remember

  • Value type matters: REG_SZ, REG_DWORD, REG_EXPAND_SZ, REG_MULTI_SZ.
  • REG_EXPAND_SZ expands %variables%.
  • DWORD data can be entered as hex or decimal.

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

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=3036

Confirmation

Confirm action

Continue?