M morphly New member Joined May 3, 2019 Posts 3 May 3, 2019 #1 Hi there, I have a Laptop with a corrupt COMPONENTS registry hive. Regback folder is empty unfortunately. SFCFix, SFC and DISM throw errors after some seconds. COMPONENTS is not totally empty so I have hope that someone can fix it. Please find cbs.log attached. COMPONENTS.ZIP uploaded here COMPONENTS.ZIP Regards Attachments CBS.log 11.7 KB · Views: 1
Hi there, I have a Laptop with a corrupt COMPONENTS registry hive. Regback folder is empty unfortunately. SFCFix, SFC and DISM throw errors after some seconds. COMPONENTS is not totally empty so I have hope that someone can fix it. Please find cbs.log attached. COMPONENTS.ZIP uploaded here COMPONENTS.ZIP Regards
M morphly New member Joined May 3, 2019 Posts 3 May 4, 2019 #2 Managed to fix it myself. Exported COMPONENTS hive with RegFileExport and imported it into a new clean hive.
Managed to fix it myself. Exported COMPONENTS hive with RegFileExport and imported it into a new clean hive.
writhziden Administrator, .NET/UWP Developer Staff member Joined May 23, 2012 Posts 2,923 Location Colorado May 4, 2019 #3 Glad you were able to fix it on your own. I am guessing you did something like the following? Code: Reg export "HKEY_LOCAL_MACHINE\COMPONENTS" "%UserProfile%\Desktop\Components.reg" CleanComponents.bat Reg import "%UserProfile%\Desktop\Components.reg" But how did you make sure you imported it into "a new clean hive," e.g. CleanComponents.bat would have what in its place? EDIT: For others who might have similar issues, I strongly advise reading the following before attempting repairs to the COMPONENTS hive: Restoring a Backup of the COMPONENTS Hive - What are the issues? Last edited: May 4, 2019
Glad you were able to fix it on your own. I am guessing you did something like the following? Code: Reg export "HKEY_LOCAL_MACHINE\COMPONENTS" "%UserProfile%\Desktop\Components.reg" CleanComponents.bat Reg import "%UserProfile%\Desktop\Components.reg" But how did you make sure you imported it into "a new clean hive," e.g. CleanComponents.bat would have what in its place? EDIT: For others who might have similar issues, I strongly advise reading the following before attempting repairs to the COMPONENTS hive: Restoring a Backup of the COMPONENTS Hive - What are the issues?
M morphly New member Joined May 3, 2019 Posts 3 May 4, 2019 #4 Basically what I did was the following: Using RegFileExport from NirSoft (as normal windows tools would refuse to load the registry hive) RegFileExport.exe [Path to broken COMPONENTS hive file] COMPONENTS.reg Luckily this did not produce any errors and I did a quick check with notepad if the contents looks like a regular reg-file. Then I created an empty reg hive to import to using this Powershell code Peter Hinchley : Create a New Registry Hive using PowerShell (comment out line 123) reg load HKLM\TEMPHIVE [Path to empty hive file] Open COMPONENTS.reg with an editor and search&replace all occurrences of "[HKEY_LOCAL_MACHINE\COMPONENTS" with "[HKEY_LOCAL_MACHINE\TEMPHIVE" - save the file reg import COMPONENTS.reg reg unload HKLM\TEMPHIVE Then I copied/renamed the hive file to it's original destination and ran "sfc /scannow" successful. Also patches did instantly install properly afterwards
Basically what I did was the following: Using RegFileExport from NirSoft (as normal windows tools would refuse to load the registry hive) RegFileExport.exe [Path to broken COMPONENTS hive file] COMPONENTS.reg Luckily this did not produce any errors and I did a quick check with notepad if the contents looks like a regular reg-file. Then I created an empty reg hive to import to using this Powershell code Peter Hinchley : Create a New Registry Hive using PowerShell (comment out line 123) reg load HKLM\TEMPHIVE [Path to empty hive file] Open COMPONENTS.reg with an editor and search&replace all occurrences of "[HKEY_LOCAL_MACHINE\COMPONENTS" with "[HKEY_LOCAL_MACHINE\TEMPHIVE" - save the file reg import COMPONENTS.reg reg unload HKLM\TEMPHIVE Then I copied/renamed the hive file to it's original destination and ran "sfc /scannow" successful. Also patches did instantly install properly afterwards