From: Michal Suchanek Date: 2010-07-08T21:45:56+09:00 Subject: Re: Changing registry values with Win32::Registry On 8 July 2010 12:37, Navaneet Kumar wrote: > Heesob Park wrote: >> Hi, >> >> 2010/7/8 Navaneet Kumar : >>>> non-existing keys, you can try this: >>> having null. I mean the 'name' key is not exist in that path. How do we >>> handle this in ruby. >>> >> You can handle it like this: >> >>   begin >>   if (reg.read_i(name)!="") >>              return reg.read_i(name) >>         end >>   rescue Win32::Registry::Error => e >>   if e.code == 2 >>     puts "#{name} key not exist!" >>   end >>   end >> >> >> Regards, >> >> Park Heesob > > Thanks Park... > > I would do something like reg.read_i(name) rescue nil unless I wanted to know exactly what went wrong. I wrote some hacks for replacing key values in registry so I can dig them up if you want. HTH Michal