Skip to content

End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

class method

Win32::Registry.open

open(hkey, subkey, desired = KEY_READ, opt = REG_OPTION_RESERVED) { |obj| ... }

— Registry.open(key, subkey, desired = KEY_READ, opt = REG_OPTION_RESERVED)

— Registry.open(key, subkey, desired = KEY_READ, opt = REG_OPTION_RESERVED) { |reg| … }

Open the registry key subkey under key. key is Win32::Registry object of parent key. You can use predefined key HKEY_* (see Constants) desired and opt is access mask and key option. For detail, see the MSDN. If block is given, the key is closed automatically.

See also #open #open? .new .time2wtime also in 4.0 · 3.4 · 3.3 · 3.2 · 3.1