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

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/Windows/...', 1759267035, '216.73.216.128', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Windows/registry/tree-structure/default-value(60): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78