如果当您尝试在 Windows 10 设备上运行 DISM 命令时遇到“(running the DISM command)错误 1009:配置注册表数据库已损坏(Error 1009: The configuration registry database is corrupt)”,那么这篇文章旨在帮助您。在这篇文章中,我们将提供您可以尝试成功解决此问题的最合适的解决方案。本文中的解决方案适用于 10xx 系列中的其他DISM错误。(DISM)如果不是这种情况,请在帖子后的评论部分中知道。
当您尝试通过在命令提示符中使用以下DISM命令之一来(DISM)修复具有损坏(损坏)注册表的 Windows 映像时,可能会出现(repair a Windows image)DISM错误 1009:(DISM)
Dism /Online /Cleanup-Image /Restorehealth
Dism /Online /Cleanup-image /Restorehealth /source:wim:X:\sources\install.wim:1 /LimitAccess
在Windows 恢复环境 (WinRE)中运行下面的DISM命令时,您也可能会遇到此错误。
Dism.exe /Image:X:\ /Cleanup-Image /Restorehealth
触发此错误的第二种情况是Windows 10上的(Windows 10)Windows更新失败。通常,错误代码表示由损坏的注册表文件引起的错误,必须修复它们才能解决问题。
DISM 错误 1009(DISM Error 1009) – 配置注册表数据库已损坏
如果您遇到此问题,您可以尝试以下我们推荐的解决方案(不分先后顺序),看看是否有助于解决问题。
- 删除 Windows 更新
- 从备份中恢复注册表
- 执行系统还原
- 执行(Perform)Windows 10 就地升级修复
让我们看一下关于列出的每个解决方案所涉及的过程的描述。
在解决错误之前,您需要拥有 Windows 10安装介质 - (Installation Media –)DVD或USB。如果您手边没有它,那么您可以在工作的 Windows 10 PC上创建安装介质(create the installation media),或者在 Linux 或 Mac 计算机上创建安装介质(如果有的话)。
1]删除Windows更新
如果您在安装更新后开始遇到问题,您需要使用安装媒体从您的 Windows 10 PC 中删除这些更新。就是这样:
- 使用 Windows 10 安装媒体启动您的计算机(Boot your computer with Windows 10 installation media)。
- 在启动屏幕上,按Shift + F10命令提示符(Command Prompt),或者,您可以单击下一步(Next),然后选择Repair your computer > Troubleshoot > Command Prompt.
- 在CMD提示符下,键入以下命令并按Enter:
wmic logicaldisk get name
- 接下来,
dir C:
在命令提示符中键入以找到包含Windows文件夹的驱动器。它是安装了Windows的驱动器。将 C 替换(Replace C)为安装Windows的驱动器的字母表。 - 一旦您确定了包含Windows文件夹的驱动器。然后,您可以键入
C:
并按Enter。如果不是 C,请输入适当的字母。 - 接下来,您应该通过键入以下命令并按Enter在驱动器上创建一个临时文件夹:
mkdir C:\Scratch
DISM /Image:C:\ /ScratchDir:C:\Scratch /Cleanup-Image /RevertPendingActions
命令执行后,您将收到以下消息;
Reverting pending actions from the image….
The operation was completed. Any revert of pending actions will be attempted after the reboot
The operation completed successfully.
- 收到上述消息后,您可以退出命令提示符(Command Prompt)并重新启动 PC。
如果Windows成功启动,一切都很好。但是,如果它无法启动并尝试再次安装更新,请执行以下操作:
- 像以前一样重新启动您的 PC 并使用安装媒体启动。
- 按照上述步骤启动命令提示符。
- 您现在按该顺序运行以下三个命令,并在每行后按Enter 。替换
C:
为您的驱动器号。
del C:\Windows\SoftwareDistribution
del C:\Windows\WinSxS\cleanup.xml
del C:\Windows\WinSxS\pending.xml
执行命令后,重新启动 PC。
如果系统仍然无法再次启动,您应该从安装媒体再次启动并打开命令提示符,然后运行以下命令集。C:
按照前面的步骤更换您的驱动器。
chkdsk /f C:
sfc /scannow /offbootdir=C:\ /offwindir=C:\windows
dism /image:C:\ /cleanup-image /restorehealth
执行命令后,重新启动计算机。
DISM 错误 1009 - 配置注册表数据库已损坏(DISM Error 1009 – The configuration registry database is corrupt)错误现在应该得到解决。如果没有,请尝试下一个修复。
2]从备份中恢复注册表
此解决方案要求您使用RegBack(RegBack)文件夹还原Windows注册表。就是这样:
- (Boot)使用Windows 10(Windows 10)安装媒体启动计算机并访问命令提示符(Command Prompt),如上所示。
- 键入
C:
并按Enter打开驱动器上的Windows文件夹。替换C:
为您的驱动器号。 - 接下来,在CMD提示符下,键入以下命令并在每行后按Enter :
cd \windows\system32\config
md Backup
copy *.* Backup
- 现在,通过在命令提示符下运行命令导航到RegBack文件夹。(RegBack)
cd RegBack
会有两种情况:首先,会有一个文件列表,它们的大小将以字节为单位显示,您可能会注意到具有零字节 (0) 的文件。这表明此类注册表文件已损坏或为空,这应该是问题的原因。您现在应该停在这里,因为最好的办法是将Windows 10恢复到以前的工作状态,我们将在下面的解决方案 3(Solution 3) 中概述。
第二种情况是当显示的所有文件都没有零字节 (0) 时。在这种情况下,您需要运行以下命令:
copy *.* ..
- 执行此命令会将注册表文件从Windows\System32\Config\RegBack文件夹复制到Windows\System32\Config\文件夹。
- 如果出现提示,您应该按键盘上的字母A来覆盖目标文件夹中的文件。
- 文件完成复制后,您现在键入
exit
并按Enter退出命令提示符。 - 重新启动您的电脑。
如果您无法成功启动到桌面,您应该使用安装媒体再次启动并打开命令提示符并一一运行这些命令:
chkdsk /f C:
sfc /scannow /offbootdir=C:\ /offwindir=C:\windows
dism /image:C:\ /cleanup-image /restorehealth
执行命令后,重新启动 PC。它应该毫无问题地启动到桌面。否则(Otherwise),请尝试下一个解决方案。
3]执行系统还原
如上述修复中所述,如果您在前面列出的某些文件中收到零(0) 值。(Zero)您需要恢复 Windows 10,因为它显示注册表已严重损坏。
注意(Note):如果您可以启动到桌面,则可以按照本指南中的说明执行系统还原 -(System Restore –)否则,请按照以下说明进行操作。
- (Boot)使用Windows 10(Windows 10)安装媒体启动您的计算机。
- 在启动屏幕上,单击下一步(Next),然后选择Repair your computer > Troubleshoot > Advanced Options.
- 接下来,选择System Restore,或者在某些 PC 中,您会看到选项Go back to a previous build。
- 现在,在下一个屏幕中选择您的操作系统。(select your operating system)
- 在系统还原向导中单击下一步。(Next)
- 选择还原点。您需要选择系统正常工作的日期。
- 单击下一步(Next)开始系统还原过程。完成后,系统会提示您重新启动 PC,或者在大多数情况下,它会自动重新启动。
如果问题仍未解决,请尝试下一个解决方案。
4]执行(Perform)Windows 10就地升级修复
如果无法通过系统还原修复此错误,最终的解决方案是执行 Windows 10 就地升级修复,如果不成功,您可以备份文件,然后全新安装 Windows 10(clean install Windows 10)。
希望这可以帮助!
相关帖子(Related post):修复 DISM 错误 87、112、11、50、2、3、87,1726、1393、1910、0x800f081f 等(Fix DISM Errors 87, 112, 11, 50, 2, 3, 87,1726, 1393, 1910, 0x800f081f, etc)。
DISM Error 1009 - The configuration registry database is corrupt
If when you attempt running the DISM command on your Windows 10 device and you encounter “Error 1009: The configuration registry database is corrupt“, then this post is intended to help you. In this post, we will provide the most suitable solutions you can try to successfully resolve this issue. The solutions in this post applies to other DISM errors in the 10xx series. Let’s know in the comment section after the post if that’s not the case.
The DISM error 1009 can appear when you try to repair a Windows image with a damaged (corrupted) registry, by using one of the following DISM commands in command prompt:
Dism /Online /Cleanup-Image /Restorehealth
Dism /Online /Cleanup-image /Restorehealth /source:wim:X:\sources\install.wim:1 /LimitAccess
You may also encounter this error when running the DISM command below in Windows Recovery Environment (WinRE).
Dism.exe /Image:X:\ /Cleanup-Image /Restorehealth
The second scenario that triggers this error is when the Windows update failed on Windows 10. Generally, the error code indicates an error caused by corrupt registry files and they have to be fixed to solve the problem.
DISM Error 1009 – The configuration registry database is corrupt
If you’re faced with this issue, you can try our recommended solutions below in no particular order and see if that helps to resolve the issue.
- Remove Windows update
- Restore registry from backup
- Perform System Restore
- Perform Windows 10 in-place upgrade repair
Let’s take a look at the description of the process involved concerning each of the listed solutions.
Before solving the error, you need to have your Windows 10 Installation Media – that’s either a DVD or USB. If you don’t have it handy, then you can create the installation media on a working Windows 10 PC or create the installation media on a Linux or Mac computer if that’s what you have available.
1] Remove Windows update
If you started experiencing the problem after installing updates, you need to remove these updates from your Windows 10 PC using the installation media. Here’s how:
- Boot your computer with Windows 10 installation media.
- On the boot screen, open Command Prompt by pressing Shift + F10, or alternatively, you can click on Next and then select Repair your computer > Troubleshoot > Command Prompt.
- In the CMD prompt, type the command below and hit Enter:
wmic logicaldisk get name
- Next, type
dir C:
in the command prompt to locate the drive that has the Windows folder. It’s the drive that has Windows installation. Replace C with the alphabet of your drive where Windows is installed. - Once you identify the drive that contains the Windows folder. you can then type
C:
and hit Enter. If it’s not C, input the appropriate letter. - Next, you should create a scratch folder on your drive by typing the command below and hit Enter:
mkdir C:\Scratch
- Now, run the command below to roll back the updates you have installed.
DISM /Image:C:\ /ScratchDir:C:\Scratch /Cleanup-Image /RevertPendingActions
Once the command executes, you’ll get the following message;
Reverting pending actions from the image….
The operation was completed. Any revert of pending actions will be attempted after the reboot
The operation completed successfully.
- After receiving the above message, you can exit Command Prompt and restart your PC.
If Windows boots successfully, it’s all fine and good. But if it fails to boot and is attempting to install the updates again, do the following:
- Restart your PC and boot using the installation media as you did previously.
- Launch the command prompt following the steps above.
- You now run the following three commands in that order and hit Enter after each line. Replace
C:
with your drive letter.
del C:\Windows\SoftwareDistribution
del C:\Windows\WinSxS\cleanup.xml
del C:\Windows\WinSxS\pending.xml
After you execute the commands, restart your PC.
If the system still fails to boot again, you should boot again from installation media and open the command prompt, then run the following set of commands. Replace C:
with your drive as in the previous steps.
chkdsk /f C:
sfc /scannow /offbootdir=C:\ /offwindir=C:\windows
dism /image:C:\ /cleanup-image /restorehealth
After you execute the commands, restart your computer.
The DISM Error 1009 – The configuration registry database is corrupt error should be resolved now. If not, try the next fix.
2] Restore registry from backup
This solution requires you to restore the Windows registry using the RegBack folder. Here’s how:
- Boot your computer with Windows 10 installation media and access the Command Prompt as shown above.
- Type
C:
and hit Enter to open the Windows folder on the drive. Replace C:
with your drive letter. - Next, in the CMD prompt, type the command below and hit Enter after each line:
cd \windows\system32\config
md Backup
copy *.* Backup
- Now, navigate to the RegBack folder by running the command
cd RegBack
in the command prompt.
There would be two scenarios: first, there would be a list of files, and their sizes will be displayed in bytes, you might notice files that have zero bytes (0). This shows that such registry files are either corrupt or empty and that should be the cause of the problem. You should now stop here because the best thing to do here is to restore Windows 10 to a previous working state which we’ll outline in Solution 3 below.
The second scenario is that when none of the files displayed have zero bytes (0). In this case, you need to run the command below:
copy *.* ..
- Executing this command will copy registry files from Windows\System32\Config\RegBack folder to Windows\System32\Config\ folder.
- If you’re prompted, you should press the letter A on your keyboard to overwrite the files in the destination folder.
- Once the files have finished copying, you now type
exit
and hit Enter to exit the command prompt. - Restart your PC.
If you’re not able to boot successfully to the desktop, you should boot again with installation media and open the command prompt and run these commands one by one:
chkdsk /f C:
sfc /scannow /offbootdir=C:\ /offwindir=C:\windows
dism /image:C:\ /cleanup-image /restorehealth
After you execute the commands, restart your PC. It should boot to the desktop without issues. Otherwise, try the next solution.
3] Perform System Restore
As mentioned in the fix above, if you received a Zero (0) value in some of the files listed earlier. You need to restore Windows 10 because it shows that the registry is seriously damaged.
Note: If you can boot to the desktop, you can follow the instructions in this guide to perform the System Restore – otherwise, follow the instructions below.
- Boot your computer with Windows 10 installation media.
- On the boot screen, click on Next and then select Repair your computer > Troubleshoot > Advanced Options.
- Next, choose System Restore, or in some PC’s you’ll see the option Go back to a previous build.
- Now, select your operating system in the next screen.
- Click Next at the System Restore Wizard.
- Select the restore point. You need to select a date when your system was working normally.
- Click Next to start the system restore process. When finished you’ll be prompted to restart your PC, or in most cases, it will restart automatically.
If the issue is still unresolved, try the next solution.
4] Perform Windows 10 in-place upgrade repair
If this error couldn’t be fixed with system restore, the final solution is to perform Windows 10 In-Place Upgrade Repair and if that’s unsuccessful, you can back up your files and then clean install Windows 10.
Hope this helps!
Related post: Fix DISM Errors 87, 112, 11, 50, 2, 3, 87,1726, 1393, 1910, 0x800f081f, etc.