none
Changing REG Keys associated with HKCU for all users that log on? RRS feed

  • Question

  • Hi,

    Is it possible to change a reg Key E.G  

     "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v ShowSuperHidden /t REG_DWORD /d 1 /f

    So that is applied to all users rather than just the current user. I am setting up a new scripted install and want most things to run off automatically via scripting. I know there is HKUsers\default but is it wise to make the change within their rather than HKCU?

    It will be on a windows XP machine.

    Thanks in advance 

     

    Friday, March 4, 2011 9:39 AM

All replies

  • Use HKEY_LOCAL_MACHINE instead of HKEY_CURRENT_USER
    Friday, March 4, 2011 10:07 AM
  • Hi Chris,

     

    Thanks for the reply. I should probably have been more specific. The users that will be logging on are via an AD domain.

    I have added the key into the HKLM but it does not seem to work.

    Any ideas?

    Thanks

    Friday, March 4, 2011 10:41 AM
  • Distribute it in a GPO logon script.

    John

    PS.  HKEY_USERS\.DEFAULT is the machine profile.

    Friday, March 4, 2011 12:53 PM
  • unfortunately, at my company they do not want to do this via GPO and want it applied to the computer via the scripted install.

    so if i change the reg key in the .DEFAULT path that will take effect for all users that log on? without having any adverse affects?

    thanks for the help

    Friday, March 4, 2011 1:37 PM
  • so if i change the reg key in the .DEFAULT path that will take effect for all users that log on? without having any adverse affects?

    No, HKU\.DEFAULT is the machine profile, it is not the Default User profile, changes there are not copied or applied to user profiles.  This is the profile that the machine uses when no one is logged on, it sets things like wallpaper and screen savers to be used before a user logs on or when no one is logged on or for machine specific things.

    If you want to make this part of your deployment then make the changes to the Default User profile (\Documents and Settings\Default User\NTUSER.DAT), this is the profile that is used when new users are created.  See typical deployment methods here:

    http://blogs.technet.com/b/deploymentguys/archive/2009/10/29/configuring-default-user-settings-full-update-for-windows-7-and-windows-server-2008-r2.aspx

    John

    Friday, March 4, 2011 2:08 PM
  • Thanks for your help john..

    I have managed to convice my manager to use GPO for this setting. Do you happen to know whereabouts within GP that i can change this?

    Thanks

    Friday, March 4, 2011 2:18 PM
  • User Configuration\Policies\Windows Settings\Scripts (Logon/Logoff)

    One disadvantage running it there is that the script will run every time that the user logs on but this registry change only needs to be applied once.  To overcome this have the script create a marker file and then use "if exist" & "goto" statements to determine if the script should be run.

    You could also put the script in the \Default User\Start Menu\Programs\Startup folder in your deployment image, have the script's final action delete the script/batch file.

    John

    Friday, March 4, 2011 3:39 PM