Solved breaking down the complex .reg file into smaller .reg files


Sheikh

Software Developer
Member
Local time
9:01 PM
Posts
334
Location
Tehran, IRAN.
OS
Windows 11 Pro 24H2
Hi
I want to do the reverse of this thread. is there anyway?

ATTENTION!
DO NOT RUN THIS FILE
 

Attachments

My Computers

System One System Two

  • OS
    Windows 11 Pro 24H2
    Computer type
    Laptop
    Manufacturer/Model
    Huawei MateBook D15
    CPU
    Ryzen 5 3500U
    Memory
    8GB
    Graphics Card(s)
    Vega 8
    Screen Resolution
    FHD
    Hard Drives
    256GB Samsung SSD + 1TB HDD
    Browser
    Microsoft Edge
    Antivirus
    ESET Smart Security Premium
  • Operating System
    Windows 10 Enterprise LTSC 21H2
    Computer type
    Laptop
    Manufacturer/Model
    MSI GS73 6RF Stealth Pro
    CPU
    intel core i7 6700HQ
    Memory
    16GB
    Graphics card(s)
    Nvidia Geforce GTX1060 (6GB)
    Screen Resolution
    FHD
    Hard Drives
    128GB SSD + 1TB HDD
    Browser
    Microsoft Edge
    Antivirus
    Windows Defender
  1. Make new reg file
  2. Add the header line
  3. Copy and paste what you want into reg file
Nothing simpler than that. If you want more intelligence to the split you could script a solution with regex patterns
 

My Computer

System One

  • OS
    Linux Mint
    Computer type
    Laptop
    Manufacturer/Model
    System76 Lemur Pro
  1. Make new reg file
  2. Add the header line
  3. Copy and paste what you want into reg file
Nothing simpler than that. If you want more intelligence to the split you could script a solution with regex patterns
Hummmm
it's more than 2500 lines !
 
Last edited:

My Computers

System One System Two

  • OS
    Windows 11 Pro 24H2
    Computer type
    Laptop
    Manufacturer/Model
    Huawei MateBook D15
    CPU
    Ryzen 5 3500U
    Memory
    8GB
    Graphics Card(s)
    Vega 8
    Screen Resolution
    FHD
    Hard Drives
    256GB Samsung SSD + 1TB HDD
    Browser
    Microsoft Edge
    Antivirus
    ESET Smart Security Premium
  • Operating System
    Windows 10 Enterprise LTSC 21H2
    Computer type
    Laptop
    Manufacturer/Model
    MSI GS73 6RF Stealth Pro
    CPU
    intel core i7 6700HQ
    Memory
    16GB
    Graphics card(s)
    Nvidia Geforce GTX1060 (6GB)
    Screen Resolution
    FHD
    Hard Drives
    128GB SSD + 1TB HDD
    Browser
    Microsoft Edge
    Antivirus
    Windows Defender
Hi
I want to do the reverse of this thread. is there anyway?
The task you set is not entirely clear. As far as I understand, do you want to run reg files from a single, main one, i.e. make a choice to run some file you need at the moment?
 

My Computer

System One

  • OS
    Windows 11 Stable, Release Preview, Beta, Dev, Canary
    Computer type
    PC/Desktop
    Manufacturer/Model
    Micro-Star International Co., Ltd. MS-7D54
    CPU
    AMD Ryzen 9 PRO 5950X
    Motherboard
    MSI MAG X570S Tomahawk Max WiFi (MS-7D54) (2 PCI-E x1, 2 PCI-E x16, 2 M.2, 4 DDR4 DIMM, Audio, Video, 2.5GbE LAN, WiFi)
    Memory
    128 Gb
    Graphics Card(s)
    Intel(R) Arc(TM) A380 Graphics (2 ГБ)
    Sound Card
    Устройство с поддержкой High Definition Audio
    Monitor(s) Displays
    HP X34 [34" LCD] (6CM1300J5J) {2021}
    Screen Resolution
    3440x1440
    Hard Drives
    KINGSTON SFYRD2000G (2000 ГБ, PCI-E 4.0 x4)
    PSU
    Be Quiet! Dark Rock Pro 4
    Case
    Cooler Master HAF XB EVO
    Internet Speed
    1000 Mb/s
    Browser
    Chrome
    Antivirus
    Windows Defender
The task you set is not entirely clear. As far as I understand, do you want to run reg files from a single, main one, i.e. make a choice to run some file you need at the moment?
I want to break it into multiple .reg files.
in each of them there should be only one change for registry.

example:

Complex REG file:
Code:
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\SettingSync]
"DisableWindowsSettingSync"=dword:00000002
[HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\SettingSync]
"DisableWindowsSettingSyncUserOverride"=dword:00000002
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\HvHost]
"Start"=dword:00000004
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\vmickvpexchange]
"Start"=dword:00000004
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\vmicguestinterface]
"Start"=dword:00000004
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\vmicshutdown]
"Start"=dword:00000004
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\vmicheartbeat]
"Start"=dword:00000004
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\vmicvmsession]
"Start"=dword:00000004
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\vmicrdv]
"Start"=dword:00000004
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\vmictimesync]
"Start"=dword:00000004
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\vmicvss]
"Start"=dword:00000004
[HKEY_CURRENT_USER\SYSTEM\ControlSet001\Services\HvHost]
"Start"=dword:00000004
to
Simple REG File1:
Code:
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\SettingSync]
"DisableWindowsSettingSync"=dword:00000002
Simple REG File2:
Code:
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\SettingSync]
"DisableWindowsSettingSyncUserOverride"=dword:00000002
and so on ...
 

My Computers

System One System Two

  • OS
    Windows 11 Pro 24H2
    Computer type
    Laptop
    Manufacturer/Model
    Huawei MateBook D15
    CPU
    Ryzen 5 3500U
    Memory
    8GB
    Graphics Card(s)
    Vega 8
    Screen Resolution
    FHD
    Hard Drives
    256GB Samsung SSD + 1TB HDD
    Browser
    Microsoft Edge
    Antivirus
    ESET Smart Security Premium
  • Operating System
    Windows 10 Enterprise LTSC 21H2
    Computer type
    Laptop
    Manufacturer/Model
    MSI GS73 6RF Stealth Pro
    CPU
    intel core i7 6700HQ
    Memory
    16GB
    Graphics card(s)
    Nvidia Geforce GTX1060 (6GB)
    Screen Resolution
    FHD
    Hard Drives
    128GB SSD + 1TB HDD
    Browser
    Microsoft Edge
    Antivirus
    Windows Defender

My Computers

System One System Two

  • OS
    Windows 11 Pro 24H2
    Computer type
    Laptop
    Manufacturer/Model
    Huawei MateBook D15
    CPU
    Ryzen 5 3500U
    Memory
    8GB
    Graphics Card(s)
    Vega 8
    Screen Resolution
    FHD
    Hard Drives
    256GB Samsung SSD + 1TB HDD
    Browser
    Microsoft Edge
    Antivirus
    ESET Smart Security Premium
  • Operating System
    Windows 10 Enterprise LTSC 21H2
    Computer type
    Laptop
    Manufacturer/Model
    MSI GS73 6RF Stealth Pro
    CPU
    intel core i7 6700HQ
    Memory
    16GB
    Graphics card(s)
    Nvidia Geforce GTX1060 (6GB)
    Screen Resolution
    FHD
    Hard Drives
    128GB SSD + 1TB HDD
    Browser
    Microsoft Edge
    Antivirus
    Windows Defender
I want to break it into multiple .reg files.
No offense, but I still don't understand what this will do for you. The ultimate goal of this idea? Create reg files and that's it. Or do you want to automate this action? Are there automatically many reg files from one reg file?
 

My Computer

System One

  • OS
    Windows 11 Stable, Release Preview, Beta, Dev, Canary
    Computer type
    PC/Desktop
    Manufacturer/Model
    Micro-Star International Co., Ltd. MS-7D54
    CPU
    AMD Ryzen 9 PRO 5950X
    Motherboard
    MSI MAG X570S Tomahawk Max WiFi (MS-7D54) (2 PCI-E x1, 2 PCI-E x16, 2 M.2, 4 DDR4 DIMM, Audio, Video, 2.5GbE LAN, WiFi)
    Memory
    128 Gb
    Graphics Card(s)
    Intel(R) Arc(TM) A380 Graphics (2 ГБ)
    Sound Card
    Устройство с поддержкой High Definition Audio
    Monitor(s) Displays
    HP X34 [34" LCD] (6CM1300J5J) {2021}
    Screen Resolution
    3440x1440
    Hard Drives
    KINGSTON SFYRD2000G (2000 ГБ, PCI-E 4.0 x4)
    PSU
    Be Quiet! Dark Rock Pro 4
    Case
    Cooler Master HAF XB EVO
    Internet Speed
    1000 Mb/s
    Browser
    Chrome
    Antivirus
    Windows Defender
2366 lines to be exact.

What you've just learned is a nasty lesson in entrophy, or the loss of useful background details. Reg tweaks are normally provided as grouped sets of keys, and when you collapse them together in a single file, it's much harder to separate them.

Tweaks can exist in different forms:
- As a standalone reg key or value.
- As multiple keys or values. Some of the related keys or values may be in completely different paths, but work as a group.
- A reg key may have several child values, which are unrelated to other. But you combined multiple tweaks so they're mingled with each other.

You can't automate the process of splitting this file, because only someone who's familiar with the tweak (or has seen many tweaks over the years) knows where to break the file into parts. And even if you could split the keys, how would know to you label them -- other than part1.reg, part2.reg...

Instead you go back to the beginning, and just collect multiple (named) reg files in folders and have scripts that apply them in order.
 

My Computer

System One

  • OS
    Windows 7
No offense, but I still don't understand what this will do for you. The ultimate goal of this idea? Create reg files and that's it. Or do you want to automate this action? Are there automatically many reg files from one reg file?
I want to add them to NTLite registry page. This file is too huge for integrating into windows image so, i want to create multi simple files which has only 1 change in each one of them. in this way I can debug it too. I didn't merge multiple files. just created it based on my batch file on github.
 

My Computers

System One System Two

  • OS
    Windows 11 Pro 24H2
    Computer type
    Laptop
    Manufacturer/Model
    Huawei MateBook D15
    CPU
    Ryzen 5 3500U
    Memory
    8GB
    Graphics Card(s)
    Vega 8
    Screen Resolution
    FHD
    Hard Drives
    256GB Samsung SSD + 1TB HDD
    Browser
    Microsoft Edge
    Antivirus
    ESET Smart Security Premium
  • Operating System
    Windows 10 Enterprise LTSC 21H2
    Computer type
    Laptop
    Manufacturer/Model
    MSI GS73 6RF Stealth Pro
    CPU
    intel core i7 6700HQ
    Memory
    16GB
    Graphics card(s)
    Nvidia Geforce GTX1060 (6GB)
    Screen Resolution
    FHD
    Hard Drives
    128GB SSD + 1TB HDD
    Browser
    Microsoft Edge
    Antivirus
    Windows Defender
2366 lines to be exact.

What you've just learned is a nasty lesson in entrophy, or the loss of useful background details. Reg tweaks are normally provided as grouped sets of keys, and when you collapse them together in a single file, it's much harder to separate them.

Tweaks can exist in different forms:
- As a standalone reg key or value.
- As multiple keys or values. Some of the related keys or values may be in completely different paths, but work as a group.
- A reg key may have several child values, which are unrelated to other. But you combined multiple tweaks so they're mingled with each other.

You can't automate the process of splitting this file, because only someone who's familiar with the tweak (or has seen many tweaks over the years) knows where to break the file into parts. And even if you could split the keys, how would know to you label them -- other than part1.reg, part2.reg...

Instead you go back to the beginning, and just collect multiple (named) reg files in folders and have scripts that apply them in order.
maybe using %rand% name. it doesn't matter. just want to integrate it to NTLite.
 

My Computers

System One System Two

  • OS
    Windows 11 Pro 24H2
    Computer type
    Laptop
    Manufacturer/Model
    Huawei MateBook D15
    CPU
    Ryzen 5 3500U
    Memory
    8GB
    Graphics Card(s)
    Vega 8
    Screen Resolution
    FHD
    Hard Drives
    256GB Samsung SSD + 1TB HDD
    Browser
    Microsoft Edge
    Antivirus
    ESET Smart Security Premium
  • Operating System
    Windows 10 Enterprise LTSC 21H2
    Computer type
    Laptop
    Manufacturer/Model
    MSI GS73 6RF Stealth Pro
    CPU
    intel core i7 6700HQ
    Memory
    16GB
    Graphics card(s)
    Nvidia Geforce GTX1060 (6GB)
    Screen Resolution
    FHD
    Hard Drives
    128GB SSD + 1TB HDD
    Browser
    Microsoft Edge
    Antivirus
    Windows Defender
I know what you did, and I'm telling you as a Release Management process, this is the wrong approach. NTLite can import multiple reg files at the same time. So you don't need to collapse your reg files.
 

My Computer

System One

  • OS
    Windows 7
I know what you did, and I'm telling you as a Release Management process, this is the wrong approach. NTLite can import multiple reg files at the same time. So you don't need to collapse your reg files.
I don't have any .reg files except that one complex file I attached to the first post.
is it safe to use with NTLite?
 

My Computers

System One System Two

  • OS
    Windows 11 Pro 24H2
    Computer type
    Laptop
    Manufacturer/Model
    Huawei MateBook D15
    CPU
    Ryzen 5 3500U
    Memory
    8GB
    Graphics Card(s)
    Vega 8
    Screen Resolution
    FHD
    Hard Drives
    256GB Samsung SSD + 1TB HDD
    Browser
    Microsoft Edge
    Antivirus
    ESET Smart Security Premium
  • Operating System
    Windows 10 Enterprise LTSC 21H2
    Computer type
    Laptop
    Manufacturer/Model
    MSI GS73 6RF Stealth Pro
    CPU
    intel core i7 6700HQ
    Memory
    16GB
    Graphics card(s)
    Nvidia Geforce GTX1060 (6GB)
    Screen Resolution
    FHD
    Hard Drives
    128GB SSD + 1TB HDD
    Browser
    Microsoft Edge
    Antivirus
    Windows Defender
NTLite doesn't care as long as it's a proper .reg file.

On the other you have HKCU keys mixed in. Due to the annoying way W10/11 works, many HKCU keys need to be imported in Post-Setup (After logon), otherwise new user provisioning ignores those settings like they never existed.
 

My Computer

System One

  • OS
    Windows 7
NTLite doesn't care as long as it's a proper .reg file.

On the other you have HKCU keys mixed in. Due to the annoying way W10/11 works, many HKCU keys need to be imported in Post-Setup (After logon), otherwise new user provisioning ignores those settings like they never existed.
I will run the script file "Windows Optimizer V4" which will set HKCU keys after logon. is it necessary to remove HKCU keys in that .reg file for NTLite?
 
Last edited:

My Computers

System One System Two

  • OS
    Windows 11 Pro 24H2
    Computer type
    Laptop
    Manufacturer/Model
    Huawei MateBook D15
    CPU
    Ryzen 5 3500U
    Memory
    8GB
    Graphics Card(s)
    Vega 8
    Screen Resolution
    FHD
    Hard Drives
    256GB Samsung SSD + 1TB HDD
    Browser
    Microsoft Edge
    Antivirus
    ESET Smart Security Premium
  • Operating System
    Windows 10 Enterprise LTSC 21H2
    Computer type
    Laptop
    Manufacturer/Model
    MSI GS73 6RF Stealth Pro
    CPU
    intel core i7 6700HQ
    Memory
    16GB
    Graphics card(s)
    Nvidia Geforce GTX1060 (6GB)
    Screen Resolution
    FHD
    Hard Drives
    128GB SSD + 1TB HDD
    Browser
    Microsoft Edge
    Antivirus
    Windows Defender
NTLite (and most image modding tools) will mount the Default User's NTUSER.DAT and merge HKCU keys there, as it's always been done.

The problem isn't the merging process, the problem is Windows new user provisioning either ignores or resets a range of HKCU values so the Default User's profile becomes mostly useless. On a live system, you can confirm merged HKCU values exist for Default User, but that's not what a newly created user gets after their first logon.
 

My Computer

System One

  • OS
    Windows 7

My Computers

System One System Two

  • OS
    Windows 11 Pro 24H2
    Computer type
    Laptop
    Manufacturer/Model
    Huawei MateBook D15
    CPU
    Ryzen 5 3500U
    Memory
    8GB
    Graphics Card(s)
    Vega 8
    Screen Resolution
    FHD
    Hard Drives
    256GB Samsung SSD + 1TB HDD
    Browser
    Microsoft Edge
    Antivirus
    ESET Smart Security Premium
  • Operating System
    Windows 10 Enterprise LTSC 21H2
    Computer type
    Laptop
    Manufacturer/Model
    MSI GS73 6RF Stealth Pro
    CPU
    intel core i7 6700HQ
    Memory
    16GB
    Graphics card(s)
    Nvidia Geforce GTX1060 (6GB)
    Screen Resolution
    FHD
    Hard Drives
    128GB SSD + 1TB HDD
    Browser
    Microsoft Edge
    Antivirus
    Windows Defender
NTLite (and most image modding tools) will mount the Default User's NTUSER.DAT and merge HKCU keys there, as it's always been done.

The problem isn't the merging process, the problem is Windows new user provisioning either ignores or resets a range of HKCU values so the Default User's profile becomes mostly useless. On a live system, you can confirm merged HKCU values exist for Default User, but that's not what a newly created user gets after their first logon.
As I understood, HKLM has a higher priority than HKCU.
In this file, I have defined every key for HKCU for HKLM as well.
So, there should be no problem with this. Of course, I am not sure because I am new to this.
 

My Computers

System One System Two

  • OS
    Windows 11 Pro 24H2
    Computer type
    Laptop
    Manufacturer/Model
    Huawei MateBook D15
    CPU
    Ryzen 5 3500U
    Memory
    8GB
    Graphics Card(s)
    Vega 8
    Screen Resolution
    FHD
    Hard Drives
    256GB Samsung SSD + 1TB HDD
    Browser
    Microsoft Edge
    Antivirus
    ESET Smart Security Premium
  • Operating System
    Windows 10 Enterprise LTSC 21H2
    Computer type
    Laptop
    Manufacturer/Model
    MSI GS73 6RF Stealth Pro
    CPU
    intel core i7 6700HQ
    Memory
    16GB
    Graphics card(s)
    Nvidia Geforce GTX1060 (6GB)
    Screen Resolution
    FHD
    Hard Drives
    128GB SSD + 1TB HDD
    Browser
    Microsoft Edge
    Antivirus
    Windows Defender
HKLM doesn't have higher priority than HKCU. If you think that, then you don't understand how GPO preferences work.

A policy may be HKLM only.
A policy may be HKCU only.
A policy may be either HKCU or HKLM. In which case, if a HKCU setting doesn't exist then Windows will check for the HKLM version. The HKCU would take precedence if it existed.
 

My Computer

System One

  • OS
    Windows 7
Last edited:

My Computers

System One System Two

  • OS
    Windows 11 Pro 24H2
    Computer type
    Laptop
    Manufacturer/Model
    Huawei MateBook D15
    CPU
    Ryzen 5 3500U
    Memory
    8GB
    Graphics Card(s)
    Vega 8
    Screen Resolution
    FHD
    Hard Drives
    256GB Samsung SSD + 1TB HDD
    Browser
    Microsoft Edge
    Antivirus
    ESET Smart Security Premium
  • Operating System
    Windows 10 Enterprise LTSC 21H2
    Computer type
    Laptop
    Manufacturer/Model
    MSI GS73 6RF Stealth Pro
    CPU
    intel core i7 6700HQ
    Memory
    16GB
    Graphics card(s)
    Nvidia Geforce GTX1060 (6GB)
    Screen Resolution
    FHD
    Hard Drives
    128GB SSD + 1TB HDD
    Browser
    Microsoft Edge
    Antivirus
    Windows Defender
You can add whatever you want. But you have to pay attention if a HKLM key requires a reboot or not to take effect. A HKCU key may require logging out or restarting Explorer.
 

My Computer

System One

  • OS
    Windows 7
Back
Top Bottom