scottdw Absent Member.
Absent Member.
3045 views

Apply HKEY_CURRENT_USER changes to the logged in user's hive

Can someone explain the "Apply HKEY_CURRENT_USER changes to the logged in user's hive instead of .DEFAULT" option for me.

I have a few registry entries I want changed in HKCU but need to make sure they stick for new users. I need to know how to make sure the entry is applied to users who already have an account on the computer and new users created by DLU.

Thanks,
Scott
Labels (2)
0 Likes
5 Replies
Micro Focus Expert
Micro Focus Expert

Re: Apply HKEY_CURRENT_USER changes to the logged in user's hive

You always want to select the "Apply HKEY_CURRENT_USER changes to the
logged in user's hive".

The option of applying to .DEFAULT does not do what you want or what
anyone would want. It is there for legacy reasons of not changing some
initial behavior where in some cases the HKCU settings were not being
applied to the correct place.

What you will want to do use the use "REG.exe" command to load the
NTUSER.DAT file under the default user's profile and then run a REG file
to import the settings into the loaded hive. Then make sure to unload
the hive or new users will have a hard time being created.

Of course, this will not impact other profiles already on the PC.


On 4/25/2012 3:56 PM, scottdw wrote:
>
> Can someone explain the "Apply HKEY_CURRENT_USER changes to the logged
> in user's hive instead of .DEFAULT" option for me.
>
> I have a few registry entries I want changed in HKCU but need to make
> sure they stick for new users. I need to know how to make sure the entry
> is applied to users who already have an account on the computer and new
> users created by DLU.
>
> Thanks,
> Scott
>
>



--
Craig Wilson - MCNE, MCSE, CCNA
Novell Knowledge Partner

Novell does not officially monitor these forums.

Suggestions/Opinions/Statements made by me are solely my own.
These thoughts may not be shared by either Novell or any rational human.
--
Please give a hearty thumbs up to any post you find helpful!
To find articles by Craig Wilson simply follow the link: Craig Wilson's Tips!
0 Likes
scottdw Absent Member.
Absent Member.

Re: Apply HKEY_CURRENT_USER changes to the logged in user's

Ok great...thanks.

That makes sense and then every new user will inherit that from the default user. I am mostly worried about new user accounts so this should work.

Is there anyway to automate this process?

Thanks
0 Likes
Micro Focus Expert
Micro Focus Expert

Re: Apply HKEY_CURRENT_USER changes to the logged in user's hive

Only via scripting, I would hesitate to give the exact scripts since it
is a little involved, but it would involve using REG.exe to load the
profile and calling regedit /s to import your settings from a predefined
file. You could also make reg.exe calls to directly edit the settings
after you have used reg.exe to load the hive.

You should be able to google some thing to find ways to do this.

On 4/25/2012 5:46 PM, scottdw wrote:
>
> Ok great...thanks.
>
> That makes sense and then every new user will inherit that from the
> default user. I am mostly worried about new user accounts so this should
> work.
>
> Is there anyway to automate this process?
>
> Thanks
>
>



--
Craig Wilson - MCNE, MCSE, CCNA
Novell Knowledge Partner

Novell does not officially monitor these forums.

Suggestions/Opinions/Statements made by me are solely my own.
These thoughts may not be shared by either Novell or any rational human.
--
Please give a hearty thumbs up to any post you find helpful!
To find articles by Craig Wilson simply follow the link: Craig Wilson's Tips!
0 Likes
scottdw Absent Member.
Absent Member.

Re: Apply HKEY_CURRENT_USER changes to the logged in user's

No I understand...that helps alot. Thanks!

craig_wilson;2191761 wrote:
Only via scripting, I would hesitate to give the exact scripts since it
is a little involved, but it would involve using REG.exe to load the
profile and calling regedit /s to import your settings from a predefined
file. You could also make reg.exe calls to directly edit the settings
after you have used reg.exe to load the hive.

You should be able to google some thing to find ways to do this.

On 4/25/2012 5:46 PM, scottdw wrote:
>
> Ok great...thanks.
>
> That makes sense and then every new user will inherit that from the
> default user. I am mostly worried about new user accounts so this should
> work.
>
> Is there anyway to automate this process?
>
> Thanks
>
>



--
Craig Wilson - MCNE, MCSE, CCNA
Novell Knowledge Partner

Novell does not officially monitor these forums.

Suggestions/Opinions/Statements made by me are solely my own.
These thoughts may not be shared by either Novell or any rational human.
0 Likes
drops1 Absent Member.
Absent Member.

Re: Apply HKEY_CURRENT_USER changes to the logged in user's

Scott,

i use a bundle with 3 install actions to modify the default user:

1. install file: ${WINDIR}\temp\dflt.reg dummy reg file. (copy always)
2. text edit action on the dummy file (in zcm 11.1 i had to overcome inconsistent text file edit behavior. with the dummy file in place it works reliable now. you have to escape the curly braces and %% for example) EXample reg file:

Windows Registry Editor Version 5.00Windows Registry Editor Version 5.00
...
[HKEY_USERS\dflt\Software\Microsoft\Active Setup\Installed Components\>{{60B49E34-C7CC-11D0-8953-00A0C90347FF}}]
"Version"="9,0,8112,16421"
"Locale"="*"

[HKEY_USERS\dflt\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders]
"AppData"="U:"
"Local AppData"="%%LOCALAPPDATA%%"

[HKEY_LOCAL_MACHINE\Software\HRZ\Default User]
"Version"="2"
"Timestamp"="${DAY}.${MONTH}.${YEAR} ${HOUR24}:${MINUTE}:${SECOND}"


3. run cmd script

start /wait reg load HKU\dflt "${WinDisk}\Users\Default\ntuser.dat"
start /wait regedit /s ${WinDir}\Temp\dflt.reg
timeout /T 1 /NOBREAK
reg unload HKU\dflt


the timeout should not be needed. problem is if the ntuser.dat remains opened no new user can log on. you could run an additional reg unload just to make sure..

regards
--
Markus
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.