Re: Registry Permissions Error

From: Scott Adams (scott.adams@daishowaamerica.com)
Date: 02/20/03


From: "Scott Adams" <scott.adams@daishowaamerica.com>
Date: Thu, 20 Feb 2003 10:35:01 -0800


Thanks for the article. I changed my code so that I use HKCU instead of
HKLM. I was not aware that users had full control in HKCU and limited access
in HKLM.

Scott

"Michel Gallant (MVP)" <neutron@istar.ca> wrote in message
news:3E5513B0.63DE409@istar.ca...
> You are running into user permissions to access the registry. This level
of
> security is "below" .net so applies to it also.
> All settings are discussed in detail in W2k ResKit herre:
>
http://www.microsoft.com/windows2000/techinfo/reskit/en-us/default.asp?url=/
windows2000/techinfo/reskit/en-us/prork/prdd_sec_njrp.asp
>
> Note sections on HKCU versus HKLM permissions for various users.
>
> - Michel Gallant
> MVP Security
> http://www.jensign.com
>
>
> Scott Adams wrote:
>
> > Hello.
> >
> > I have created a Windows application with VB.NET that depends heavily on
> > writing to, reading from, and creating keys in the registry. All is well
on
> > my dev box which runs Win2K pro (on an Admin account). When I install
the
> > app on a user's machine who is not an Administrator (restricted security
> > policy), the user is not able to create keys in the registry. (The same
is
> > true if the user manually tries to open regedit.exe and tries to create
a
> > key.) I have researched heavily into this issue, yet the answer evades
me.
> > Can someone help please? Thanks.
> >
> > Sample code:
> > Public Sub SampleSub
> > Dim regKey as Microsoft.Win32.RegistryKey = _
> >
Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Software\MyApp",
> > True)
> > regKey.SetValue("MyValue","MyData")
> > regKey.Close
> > End Sub
> >
> > Error message is from "mscorlib"; "Requested registry access is not
> > allowed."
> >
> > Scott Adams
> > AdamsSoft Co.
>



Relevant Pages

  • Re: Windows Startup
    ... using F3 to find keys has never worked for me. ... >> thing that causes the System32 folder to open at startup. ... >> Right click hkcu on your Desktop and select: Edit | Select all the text ... >> Right click hklm on your Desktop and select: Edit | Select all the text ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: HKLM and HKCU Priority
    ... HKCU is for user DSN definition while HKLM is for system DSN definition. ... | to never remove old keys from the registry but I ...
    (microsoft.public.win2000.registry)
  • Re: DllSurrogate problem with Win XP
    ... all keys under HKCU successfully and still it tries to open the same keys under HKLM. ... I have have no clue to why it needs to access the keys under HKLM when it finds them under HKCU. ... I'm a bit unclear on who is the "current user" when the surrogate is launched... ...
    (microsoft.public.win32.programmer.ole)
  • Re: HKLM and HKCU Priority
    ... HKCU should/would take precedence over HKLM ... | (this if from a prior versions install) ... | driver which is defined by both of these keys. ...
    (microsoft.public.win2000.registry)
  • Re: How to disable the "What do you want to search for" search dialog in explorer?
    ... Yes, there are several complications, especially with the HKCU and HKLM stuff. ... Ramesh Srinivasan, Microsoft MVP [Windows Shell/User] ... to edit the new account template! ...
    (microsoft.public.windowsxp.general)