Search notes:

Windows registry structure: default value

A registry key can have an unnamed value: the default value.

Accessing default values in the command line

reg.exe

When using reg.exe, default values are specified with the /ve flag:
C:\> reg query HKCU\AppEvents\EventLabels\Open /ve

PowerShell

There are two ways to query the default value in PowerShell:
PS C:\> (get-itemProperty hkcu:\AppEvents\EventLabels\Open)."(default)"
PS C:\> (get-item hkcu:\AppEvents\EventLabels\Open).getValue('')
Similarly, the default value can be assigned PowerShell with
PS C:\> set-item hkcu:\AppEvents\EventLabels\Open -value '…'
A key's default value can be deleted as shown below. The key (subkey named '') must be opened writable by setting the second parameter to $true:
(get-item 'hkcu:\Software\tq84').OpenSubKey('', $true).DeleteValue('')

See also

Windows registry: tree structure

Index