Keys, values, and types

A registry command usually takes a key path and a separate value name. Keeping them separate avoids changing the wrong setting:

reg get Machine/System/KMES BufferCapacity
reg ls Machine/System/KMES -l

Keys and values in a command #

Keys contain subkeys and values; values do not contain other values. reg get KEY lists the key's effective values. reg get KEY NAME reads one value. The literal @ in the value-name position addresses the unnamed default value, if the key has one.

A key need not have a default value. A default value is also different from a setting's documented default: a consumer may use a compiled-in default when no registry value is present.

Keys #

Machine\System\KMES names a key. Its permissions cover the values it contains. To give two values different permissions, put them in different keys; there are no per-value permission lists.

Key-name components cannot contain \, / or a null byte. Empty components, doubled separators and trailing separators are invalid.

Values #

A value has a name, a type tag and data. Unlike a key-name component, a value name may contain / or \: it is not a path. The null byte is forbidden; the empty name is reserved for the default value.

The value types #

Use the type the owning component documents in regman. For a command-line write, an explicit prefix avoids unintended type inference:

TypeMeaning to a readerreg set prefix
REG_DWORD32-bit integerdword:
REG_QWORD64-bit integerqword:
REG_DWORD_BIG_ENDIANBig-endian 32-bit integerdword-be:
REG_SZTextsz:
REG_EXPAND_SZText whose references the consumer expandsexpand:
REG_MULTI_SZList of stringsmulti:
REG_BINARYByteshex: or bin:
REG_LINKA link target on a link keylink:
REG_NONENo typenone:

For example, sz:007 preserves the text 007. Without the prefix, reg infers an integer and loses the leading zeros. See reg value literals for encoding lists, bytes and numbers.

The hardware-resource types are retained for format fidelity and have no Peios-specific meaning. Byte encodings, including Peios UTF-8 strings and link targets, are documented in the LCS value representation.

Typed, but opaque #

The registry does not check whether ordinary value data is sensible for its consumer. A known type tag can accompany malformed data, such as a number with the wrong length. Registry Editor shows such data in red as bytes. Unknown type codes and invalid requests can still be rejected; "opaque" does not mean every write succeeds.

REG_LINK on a link key is the exception: the kernel interprets it to resolve the target. For other settings, follow Change a setting and verify it.

Names, case, and paths #

reg accepts forward slashes and backslashes as path separators. In a shell, use forward slashes or quote a backslash path:

reg get 'Machine\System\KMES' BufferCapacity

Names are case-insensitive and retain their display case. Case matching is locale-independent, but there is no Unicode normalization: visually identical names with different Unicode representations can be distinct.

Volatile keys #

A volatile key is held in memory and disappears on reboot or when its store unloads. Its children must also be volatile. reg info KEY shows whether a key is volatile; Registry Editor also shows this in the key pane.

Volatility is about persistence. It does not tell you when a setting applies. A persistent setting may still require a reboot; check the regman Applies field.

Where to go next #

Edit this page