HKCU registry tweaks??

Discuss & post Update Pack addons here.
Post Reply
mutedchild
Posts: 38
Joined: Mon Nov 01, 2010 3:17 am

HKCU registry tweaks??

Post by mutedchild » Fri Apr 22, 2011 1:24 pm

i just want to ask if i want to insert an hkcu reg tweaks which method is better? is it convert reg to inf and use nlite to insert the tweak or add reg tweaks in cmdlines.txt on t-12? which method will surely apply all my reg tweaks? TIA

mutedchild
Posts: 38
Joined: Mon Nov 01, 2010 3:17 am

Post by mutedchild » Fri Apr 22, 2011 1:31 pm

i'm an nlite user so its easier for me to convert it to inf, but i heard some hkcu tweaks are not really applying in nlite,,is it true or did nlite fix it already?

User avatar
crashfly
Posts: 789
Joined: Thu Mar 13, 2008 11:39 pm
Location: Arkansas, USA

Post by crashfly » Sat Apr 23, 2011 12:37 am

It is probably not the "applying" bit for nlite, but it more of where the tweaks get applied.

During windows setup, up until the last reboot, everything for HKCU is written to the 'default user'. If something does not get applied properly, it may be because the 'default' is changed by a startup configuration program.

Usually the best time to implement tweaks for the current user is to use the "RunOnce" option when the user first logs in. This way you can be sure those options are applied at the right time.
A mind is like a parachute, it only functions when it is open.
--Anonymous

How to Ask Questions the Smart Way

mutedchild
Posts: 38
Joined: Mon Nov 01, 2010 3:17 am

Post by mutedchild » Sat Apr 23, 2011 11:10 am

i also want the HKCU tweaks applied in all accounts and the accounts that will be created on a live system,,is it possible if i use RunOnce?

User avatar
vmanda
Posts: 1634
Joined: Wed Apr 18, 2007 12:25 pm
Location: TM.Romania

Post by vmanda » Wed Jun 01, 2011 10:58 am

i'm using one silent installer that (hidden) run one cmd at svcpack.
Presuming that you want to add this key for all users

Code: Select all

reg add "HKCU\Software\Microsoft\Windows Script\Settings" /f /v "JITDebug" /t REG_DWORD /d 0
you need to translate HKCU to HKU\.DEFAULT so cmd will look like

Code: Select all

reg add "HKU\.DEFAULT\Software\Microsoft\Windows Script\Settings"  /f /v "JITDebug" /t REG_DWORD /d 0
Same things applly if you want to add it from one reg file.

as sample see one section from mine's cmd runned as svcpack

Code: Select all

REM ====== config Hardware Update Wizard - no WU and no Floppies prompt ======
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /f /v "NoDevMgrUpdate" /t REG_DWORD /d 1
reg add "HKU\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /f /v "NoDevMgrUpdate" /t REG_DWORD /d 1
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" /f /v "DontSearchWindowsUpdate" /t REG_DWORD /d 1
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" /f /v "DontPromptForWindowsUpdate" /t REG_DWORD /d 1
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" /f /v "DontSearchCD" /t REG_DWORD /d 0
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\DriverSearching" /f /v "DontSearchFloppies" /t REG_DWORD /d 1
On this sample you can see that both HKCU and HKU\.DEFAULT are present in event that i need to
run the script to one allready installed system, that do not have mine's tweaks applied.

Note: Why to use as cmd script and not as reg file?
Because regedit will not overwrite certain reg keys, as oposite
to comand line reg.exe when /f (force) switch are used.

Use Reg2cmd, to convert reg files to cmd script. Usage: reg2cmd thisreg.reg thisreg.cmd

here is mine's cmd (TweakXP\TweakXP.cmd) and all the files needed to create silent installer/svcpavk addon
You can keep/edit mine's, add your tweaks to TweakXP\TweakXP.cmd, then just run SFX_TweakXP.cmd to create sfx(svcpack\svcpack\Tweak_XP.exe) and addon (Tweak_XP_AddOn.cab)

mutedchild
Posts: 38
Joined: Mon Nov 01, 2010 3:17 am

Post by mutedchild » Mon Feb 20, 2012 12:17 pm

thanks vmanda,, but just a few questions. both hkcu and hku\.default must be present in the cmd script, so does this mean that the accounts that will be created later on will have the same settings and tweaks? Is it ok to apply hklm tweaks on t-13? TIA.

User avatar
vmanda
Posts: 1634
Joined: Wed Apr 18, 2007 12:25 pm
Location: TM.Romania

Post by vmanda » Mon Feb 20, 2012 4:44 pm

yes, that's the reason of hku\.default registry keys.

Also, if you run script at svcpack, hkcu does not exist,
so hku\.default will store applied tweaks that will be
used at every user account creation.

hklm reg keys are present at svcpack (T-13), and tweaks on
this hklm reg branches will apply to all users.

Also note that some keys from hkcu can be overwrited
at first run by keys present into Hivedef.inf that contains
defaults for user accounts.

mutedchild
Posts: 38
Joined: Mon Nov 01, 2010 3:17 am

Post by mutedchild » Tue Feb 21, 2012 4:30 am

i am very thankful for all your help vmanda but i am really confuse cause msfn unattended xp guide said that hku\.default is not the default user. Here is the link http://unattended.msfn.org/unattended.xp/view/web/17/

User avatar
vmanda
Posts: 1634
Joined: Wed Apr 18, 2007 12:25 pm
Location: TM.Romania

Post by vmanda » Tue Feb 21, 2012 5:21 am

Do you refer to this?
HKEY_USERS\.DEFAULT

I've noticed that some MSFN and OSZone members use this hive for importing HKCU settings trying to apply them for all users. Possibly, this works; however, you already know how to import HKCU tweaks realiably and correctly. Moreover, the HKEY_USERS\.DEFAULT keys may pertain to the settings enforced before users log on (e.g. the default keyboard layout for the logon window).
Possible, i'm not "politically" correct, but adding keys to this reg branches works for me for some years.

Also, adding inno setup packages at svcpack, for example, redirect hkcu reg keys to this reg branche,
that will be converted to hkcu reg keys for every new user account.

User avatar
bphlpt
Posts: 1367
Joined: Sat Apr 19, 2008 1:11 am

Post by bphlpt » Tue Feb 21, 2012 5:52 am

mutedchild, I assume you were also referring to this:
You can import registry tweaks at a certain stage of the unattended setup when nobody has logged on yet. This task can be accomplished from cmdlines.txt at T-12. Actually, the HKCU tweaks imported at T-12 modify the Default User account settings, because the Default User's hive is loaded into HKEY_CURRENT_USER at that moment. When a user logs on to a machine for the first time, the user settings are taken from the Default User account. Hence, the HKCU tweaks imported at T-12 apply to all accounts ever created. That is why I have two separate REG files (HKCU and HKLM). I import HKCU tweaks from cmdlines.txt, and no matter how many user accounts I create, they all have the same initial user settings.

In order to import the HKCU tweaks at T-12 you need to place the HKCU.reg file into the root of the $OEM$ folder and make sure the cmdlines.txt contains the following text:

Code: Select all

[Commands]
"REGEDIT /S hkcu.reg"
The problem being that this must be done at T-12. So vamanda's examples of inno setup packages at svcpack couldn't use this other mechanism, could they?

So as long as vmanda's method is working, and I don't think they're going to change the way XP works at this point, use what works.

But you are correct. We should be aware of the correct way to do a task. We just also have to be aware of it's limitations.

Cheers and Regards

mutedchild
Posts: 38
Joined: Mon Nov 01, 2010 3:17 am

Post by mutedchild » Tue Feb 21, 2012 10:00 pm

thanks vmanda and bphlpt for all the help. I guess I will have to try both way and see what best works for me...

Post Reply