access denied when trying to write to win32 registry

S

Shea Martin

I am to this:

Win32::Registry::HKEY_CURRENT_USER.open('Software\Microsoft\SomeSoftware')
do | reg |
reg.write_s('SomeKeyName', 'my new value')
end

But it gives me an error saying that access is denied. I can
successfully read the key. Using regedit, I can change the value of the
key. Is there some flag I need to set when I open the entry?


I can't seem to find docs in rdoc.

~S
 
S

Shea Martin

Robo said:
I had that problem before, took me a long time to find out, try this:

Win32::Registry::HKEY_CURRENT_USER.open('Software\Microsoft\SomeSoftware',
Win32::Registry::KEY_WRITE) do | reg |
reg.write_s('SomeKeyName', 'my new value')
end

Robo

That was it. Thanks.
~S
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,533
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top