Say I have four registry values under the same key with these names:
When I run the script below, two of the values will be deleted. When I
run it again, one value will be deleted. On the third run, the last
value will be deleted. I don’t understand why all of the values are not
deleted on the first run.
Win32::Registry::KEY_ALL_ACCESS) do |reg|
reg.each_value do |name, type, data|
if name.include?('this_text') reg.delete_value(name) end
Could someone point out what I’m doing wrong?