RegDelEmptyParentKeys - Clean up a Windows registry file from redundant empty keys

RegDelEmptyParentKeys - Clean up a Windows registry file from redundant empty keys

4
NewbieNewbie
4

    Jan 28, 2013#1

    The purpose of this script is to clean up a Windows registry file from the redundant empty keys while preserving
    the child keys. This may be useful for example when you want to compare two registry files side by side.


    This is an example of a Windows registry file:

    Code: Select all

    
    [HKEY_CURRENT_USER\System\CurrentControlSet\Control]
    
    [HKEY_CURRENT_USER\System\CurrentControlSet\Control\MediaProperties]
    
    [HKEY_CURRENT_USER\System\CurrentControlSet\Control\MediaProperties\PrivateProperties]
    
    [HKEY_CURRENT_USER\System\CurrentControlSet\Control\Network]
    
    [HKEY_CURRENT_USER\System\CurrentControlSet\Control\Network\NetworkLocationWizard]
    "ShowCount"=dword:00000018
    
    
    The registry file after executing the script:

    Code: Select all

    
    [HKEY_CURRENT_USER\System\CurrentControlSet\Control\MediaProperties\PrivateProperties]
    
    [HKEY_CURRENT_USER\System\CurrentControlSet\Control\Network\NetworkLocationWizard]
    "ShowCount"=dword:00000018
    
    
    RegDelEmptyParentKeys.zip (1.82 KiB)   342
    script version 1

    Note
    Please make sure that the registry file is sorted first before executing the script.

    If the registry file is not sorted, you can sort it with this script: RegIniFileSort