Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Writing to HKEY_LOCAL_MACHINE fails.

Writing to HKEY_LOCAL_MACHINE fails.

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestionvisual-studiowindows-adminjson
5 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Marimuthu r
    wrote on last edited by
    #1

    Hi, I am using VS 2005 on vista platform. I want to set a registry entry located in HKEY_LOCAL_MACHINE. The following function fails. RegOpenKeyEx(HKEY_LOCAL_MACHINE, "System\\CurrentControlSet\\Control\\Windows", 0, KEY_SET_VALUE, &hKey); The return value of the above API is ERROR_ACCESS_DENIED. I have logged in as an normal user without any admin privilages. I know this funciton is failing because I donot have the privilage to perform any write operation. How do I get around this problem without having Admin privileges? I want to modify registry value located in HKEY_LOCAL_MACHINE. Could anybody help me with this issue?

    R S D J 4 Replies Last reply
    0
    • M Marimuthu r

      Hi, I am using VS 2005 on vista platform. I want to set a registry entry located in HKEY_LOCAL_MACHINE. The following function fails. RegOpenKeyEx(HKEY_LOCAL_MACHINE, "System\\CurrentControlSet\\Control\\Windows", 0, KEY_SET_VALUE, &hKey); The return value of the above API is ERROR_ACCESS_DENIED. I have logged in as an normal user without any admin privilages. I know this funciton is failing because I donot have the privilage to perform any write operation. How do I get around this problem without having Admin privileges? I want to modify registry value located in HKEY_LOCAL_MACHINE. Could anybody help me with this issue?

      R Offline
      R Offline
      Russell
      wrote on last edited by
      #2

      I think that it is not possilbe ...you need Admin privileges:(( (that is the reason why Admin exist)


      Russell

      1 Reply Last reply
      0
      • M Marimuthu r

        Hi, I am using VS 2005 on vista platform. I want to set a registry entry located in HKEY_LOCAL_MACHINE. The following function fails. RegOpenKeyEx(HKEY_LOCAL_MACHINE, "System\\CurrentControlSet\\Control\\Windows", 0, KEY_SET_VALUE, &hKey); The return value of the above API is ERROR_ACCESS_DENIED. I have logged in as an normal user without any admin privilages. I know this funciton is failing because I donot have the privilage to perform any write operation. How do I get around this problem without having Admin privileges? I want to modify registry value located in HKEY_LOCAL_MACHINE. Could anybody help me with this issue?

        S Offline
        S Offline
        Sachinpatole
        wrote on last edited by
        #3

        U will have to execute ur application as "Run as Adminstrator". Sachin

        1 Reply Last reply
        0
        • M Marimuthu r

          Hi, I am using VS 2005 on vista platform. I want to set a registry entry located in HKEY_LOCAL_MACHINE. The following function fails. RegOpenKeyEx(HKEY_LOCAL_MACHINE, "System\\CurrentControlSet\\Control\\Windows", 0, KEY_SET_VALUE, &hKey); The return value of the above API is ERROR_ACCESS_DENIED. I have logged in as an normal user without any admin privilages. I know this funciton is failing because I donot have the privilage to perform any write operation. How do I get around this problem without having Admin privileges? I want to modify registry value located in HKEY_LOCAL_MACHINE. Could anybody help me with this issue?

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          Marimuthu.pesit wrote:

          How do I get around this problem without having Admin privileges?

          Temporarily turn off UAC.


          "A good athlete is the result of a good and worthy opponent." - David Crow

          "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

          1 Reply Last reply
          0
          • M Marimuthu r

            Hi, I am using VS 2005 on vista platform. I want to set a registry entry located in HKEY_LOCAL_MACHINE. The following function fails. RegOpenKeyEx(HKEY_LOCAL_MACHINE, "System\\CurrentControlSet\\Control\\Windows", 0, KEY_SET_VALUE, &hKey); The return value of the above API is ERROR_ACCESS_DENIED. I have logged in as an normal user without any admin privilages. I know this funciton is failing because I donot have the privilage to perform any write operation. How do I get around this problem without having Admin privileges? I want to modify registry value located in HKEY_LOCAL_MACHINE. Could anybody help me with this issue?

            J Offline
            J Offline
            jhwurmbach
            wrote on last edited by
            #5

            Normaly, you set the needed Keys in HKEY_LOCAL_MACHINE at installation time. Programms write deviations from the defaults to HKEY_CURRENT_USER. That is writable without privileges.


            Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal.
            George Orwell, "Keep the Aspidistra Flying", Opening words

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups