From: "jonforums (Jon Forums)" Date: 2012-05-18T05:12:06+09:00 Subject: [ruby-core:45115] [ruby-trunk - Bug #6447] Win32::Registry#keys always returns [] even if there are keys Issue #6447 has been updated by jonforums (Jon Forums). I think it's a terminology thing, not a bug. Here's one more with subkey's containing values: >> require 'win32/registry' => true >> pdf = Win32::Registry::HKEY_CURRENT_USER.open 'Software\\PDFCreator' => # >> pdf.num_keys => 2 >> pdf.each_key do |pk| | pdf.open(pk) do |sk| | puts sk.name | sk.each_value { |v| puts " #{v}" } | end | end HKEY_CURRENT_USER\Software\PDFCreator\Ghostscript DirectoryGhostscriptBinaries DirectoryGhostscriptFonts DirectoryGhostscriptLibraries DirectoryGhostscriptResource HKEY_CURRENT_USER\Software\PDFCreator\Program AutosaveDirectory LastsaveDirectory Language PrinterTemppath => 2 ---------------------------------------- Bug #6447: Win32::Registry#keys always returns [] even if there are keys https://bugs.ruby-lang.org/issues/6447#change-26687 Author: rogerdpack (Roger Pack) Status: Open Priority: Normal Assignee: Category: Target version: ruby -v: tcs-ruby 1.9.3p28 (2012-01-28, TCS patched 2012-01-30) [i386-mingw32] ex: require 'win32/registry' @screen_reg = Win32::Registry::HKEY_CURRENT_USER.create "Software\\os_screen_capture"; @screen_reg['last_init_config_was'] = 3 >> @screen_reg.keys => [] also each_key doesn't do anything, as well. The "each" method does work as expected however. Sorry if this is a dupe. -- http://bugs.ruby-lang.org/