Results 1 to 4 of 4

Thread: Registry Editing Issues

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2019
    Posts
    12

    Registry Editing Issues

    I am trying to write multiple registry entries into HKLM\Software\Wow6432Node\program name\program tools and I keep getting Exception Unhandled messages "System.UnauthorizeAccessException: 'Access to the registry key 'HKEY_LOCAL_MACHINE\Software\Wow6432Node\program name\program tools' is denied'.

    I have tried launching my program as Administrator and User from VB, both get the error. When I try to launch the debug version the program seems to ignore the registry keys and continues the other processes without error.

    Here is what I am using:
    Code:
    My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\program name\program tools", "LoginServer", "SERVER01")
    Any help would be greatly appreciated.

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,413

    Re: Registry Editing Issues

    What is your target cpu? It needs to be anycpu and you need admin privileges

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2019
    Posts
    12

    Re: Registry Editing Issues

    If I am understanding correctly, the target cpu is the local machine. Basically the reg key just maps which server to utilize (server01 in this case). How do I elevate privileges inside the code to be able to run it and add the anycpu?

  4. #4
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,413

    Re: Registry Editing Issues

    Project—>Properties—>Compile—>Target CPU
    For the privileges...

    Project—>Properties—>Application—>View Windows Settings, and follow the instructions in app.manifest

Tags for this Thread

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