(Solved) How can we add HKCU regs via Setupcomplete.cmd

crypticus

Well-Known Member
Messages
1,664
Reaction score
461
...."Since those keys are HKCU, these require a little trick to be added during setup process because HKCU hive is not loaded yet. I could detail this later if you interested, in a dedicated trick and TIPS topic."

can u show me how to add hkcu regs? nuhi freMea
 
HKCU keys are seamlessly integrated into the defaultuser ntuser.dat file by ntlite whenever you add them using the built in add to registry key. Those keys are then automatically duplicated to all users during setup and account creation.
With regards to manually adding them, what you do is- you manually copy out the ntuser.dat hive from the defaultuser account folder when the image is mounted, manually mount it in regedit on the host, write in your edits, and then unload the hive and paste it back into the image over the old ntuser.dat.
 
HKCU keys are seamlessly integrated into the defaultuser ntuser.dat file by ntlite whenever you add them using the built in add to registry key. Those keys are then automatically duplicated to all users during setup and account creation.
Yes. I ended up with a setupcomplete solution because NTlite couldn’t handle accents chars in reg files encoded in UTF-16 little endian. This bug may have been fixed since then in 1.7.2.6680.

With regards to manually adding them, what you do is- you manually copy out the ntuser.dat hive from the defaultuser account folder when the image is mounted, manually mount it in regedit on the host, write in your edits, and then unload the hive and paste it back into the image over the old ntuser.dat.
Exactly. I will post an setupcomplete.cmd sample with the required commands for that.
 
I wanted to share this tool for working with registry tweaks. I like to export changes out of the registry and convert them using a tool when I intend to make the same changes using a script and avoid stupid mistakes on my part.
https://www.sordum.org/8478/reg-converter-v1-2/

I have used this tool a few times and wanted to share.
 
can u show me how to add hkcu regs? nuhi freMea
Add the .REG file to the Integrate - Registry page, it supports HKCU, will add it to all users.
If it doesn't work, let me know which.
Or it's important not to be set before setupcomplete?

Yes. I ended up with a setupcomplete solution because NTlite couldn’t handle accents chars in reg files encoded in UTF-16 little endian.
May I please get an example?

Thanks.
 
Last edited:
May I please get an example?

Back in the time, such key resulted bad char formatting in shell menu. It should be ok now.

Code:
Windows Registry Editor Version 5.00
; encoded in UTF-16 little endian
; ; =======================================================
; Add Open PS ADMIN to selected folder
[HKEY_CLASSES_ROOT\Directory\shell\OpenElevatedPS]
@="Ouvrir la fenêtre PowerShell ici [ADMIN]"
"Icon"="powershell.exe"
"HasLUAShield"=""
"Extended"=""
 
Back
Top