Results 1 to 10 of 10

Thread: Cannot write to registry key

  1. #1

    Thread Starter
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464

    Cannot write to registry key

    I am getting an exception when I try to set this registry setting:
    HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\Display Inline Images

    It says:
    Cannot write to the registry key.

    That is all it says...
    Anyone have a reason why?

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    if I'm not mistaken you have to edit the reg before writing .
    Do you think any security reasons behind that.I bet so

  3. #3
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    can you edit anything else in CurrentUser, beside the explorer's setting?
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  4. #4

    Thread Starter
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Yes, I can edit and create other keys in the current user section. I use the HKEY_CURRENT_USER\Software\MySoftware section for my other app settings with no problems. It is like MS set up a security thing or something on their settings.

  5. #5
    Hyperactive Member
    Join Date
    Feb 2001
    Location
    Houston, TX
    Posts
    342
    I hope this isn't a duplicate of what you already have, but I just tested this on mine and it worked.
    VB Code:
    1. Dim reg As Microsoft.Win32.Registry
    2.         Dim rk As Microsoft.Win32.RegistryKey
    3.  
    4.         rk = reg.CurrentUser.OpenSubKey("Software\Microsoft\Internet Explorer\Main", True)
    5.         rk.SetValue("Display Inline Images", MyValue)

  6. #6

    Thread Starter
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    I didn't include true as an argument for the opensubkey function. That is probably what I am doing wrong....lol. Thanks, I will try it.

  7. #7
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    aaaaaaaaaah you said it says "cannot write..." so I thought this isnt the problem. Before, I had a same problem where VB told me "permission denied". I didnt think this is the same situation
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  8. #8
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    so the problem was with security or returning value??

  9. #9
    New Member
    Join Date
    Jan 2009
    Posts
    1

    Re: Cannot write to registry key

    Code given by MagellanTX is correct. Make sure that the user under which you run your application has a right to change the registry.

  10. #10
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083

    Re: Cannot write to registry key

    Quote Originally Posted by exaspring
    Code given by MagellanTX is correct. Make sure that the user under which you run your application has a right to change the registry.
    Dude , this thread is almost 7 years ago !!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width