From: Alexandru Popescu Date: 2005-09-29T09:02:19+09:00 Subject: Re: where to look for API win32/registry #: Alan Chen changed the world a bit at a time by saying on 9/29/2005 12:46 AM :# > Alexandru Popescu wrote: >> Hi! >> >> I am trying to write a small script that cleans up the registry after starting Skype (which on >> regular basis registers itself in Run). >> >> What I am looking now is the API of Win32::Registry. Where can I find it? >> >> So far I have done this: >> >> require 'win32/registry' >> Run_branch = 'Software\Microsoft\Windows\CurrentVersion\Run' >> Skype_key = 'Skype' >> Win32::Registry::HKEY_CURRENT_USER.open(Run_branch, Win32::Registry::Constants::KEY_ALL_ACCESS) do | >> | reg | >> reg_typ, reg_val = reg.read(Skype_key) >> puts "type: #{reg_typ}" >> puts "val : #{reg_val}" > > If you haven't built, or don't have an install of, the rdoc > documentation for Ruby, you can find it at > http://www.ruby-doc.org/stdlib/ > > Modifying and deleting is fairly easy, IIRC: > > reg[Skype_key] = "new value" > reg.delete_key(Skype_key) > > Cheers, > - alan > > > delete_key results in error: Win32::Registry::Error: The system cannot find the file specified. from c:/ruby/ruby-1.8.2-15/lib/ruby/1.8/win32/registry.rb:800:in `delete_key' from (irb):6 from (irb):5:in `open' from c:/ruby/ruby-1.8.2-15/lib/ruby/1.8/win32/registry.rb:608:in `open' from (irb):5 ./alex -- .the_mindstorm.