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. Database & SysAdmin
  3. System Admin
  4. How to change HKCU registry as the admin

How to change HKCU registry as the admin

Scheduled Pinned Locked Moved System Admin
c++windows-admintutorialquestion
2 Posts 2 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.
  • C Offline
    C Offline
    caykahve
    wrote on last edited by
    #1

    I want to create a string value DisableLockWorkStation under the key HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System. The user is not allowed to do it. (I want to do it for NT4, Win2k, and XP). The manual way is to login as the administrator, run regedt32, and load the registry hive ntuser.dat file of the user from Documnents and Settings under HKEY_USERS. Afterwards create the new value and unload the hive. But then the administrator should repeat it for every user. How can the administrator do a change that affects every user? I tried creating the value in the relevant key in [HKEY_USERS\.DEFAULT]. It didn't affect either the user or the administrator. Actually I want to do this during the installation of my program. So the solution has to be convertible to C++ for me. Thank you...

    M 1 Reply Last reply
    0
    • C caykahve

      I want to create a string value DisableLockWorkStation under the key HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System. The user is not allowed to do it. (I want to do it for NT4, Win2k, and XP). The manual way is to login as the administrator, run regedt32, and load the registry hive ntuser.dat file of the user from Documnents and Settings under HKEY_USERS. Afterwards create the new value and unload the hive. But then the administrator should repeat it for every user. How can the administrator do a change that affects every user? I tried creating the value in the relevant key in [HKEY_USERS\.DEFAULT]. It didn't affect either the user or the administrator. Actually I want to do this during the installation of my program. So the solution has to be convertible to C++ for me. Thank you...

      M Offline
      M Offline
      Mike Dimmick
      wrote on last edited by
      #2

      The way to edit this is to use Group Policy. See this page[^] for details (Google's cache of a page on microsoft.com). I'd recommend asking the administrator to do this. If you're in an Active Directory network environment the administrator can do this by creating a Group Policy object with the setting; place all the computers you want the setting to affect in the same Organizational Unit in AD, and link the GPO to that container. If you want a global policy for your organisation, create the GPO in the domain root. If you must do it on a local system through code, you can use the IGroupPolicyObject interface to edit the local GPO. Stability. What an interesting concept. -- Chris Maunder

      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