Windows将使其工作的几乎所有内容都存储在一个名为Windows 注册表(Windows Registry)的基于文件的分层数据库中。注册表包含操作系统(operating system)、程序、服务、组件和几乎所有其他内容的所有配置设置。从图标大小到任务栏颜色的所有内容都存储在那里。
注册表由数百万个键和值组成。您可以将键视为文件夹,将值视为存储在文件夹中的数据。在注册表编辑器(registry editor)中,键实际上看起来像文件夹,而值是保存实际设置的内容。注册表中的每个键都可以有多个值,就像一个文件夹可以存储多个文件一样。
此外,值可以存储不同类型的数据,包括String、Binary、DWORD、QWORD等。您实际上并不需要了解该级别的详细信息,但希望您了解注册表的结构。
在备份注册表方面,您实际上有两种选择:通过导出手动备份注册表的部分或使用System Restore备份整个注册表。当您对注册表进行更改时,最好创建一个还原点(restore point),然后备份注册表的已编辑部分。
有一种方法可以导出整个注册表,但这不是一个好的选择,原因有几个。首先,您将获得一个必须存储在某处的大文件。其次,如果您只更改一个设置,稍后尝试重新导入整个注册表可能会覆盖导出后写入注册表其他部分的许多其他较新值。这实际上会导致更多问题和可能的腐败。最后,您甚至可能无法重新导入整个注册表,因为Windows将使用大量密钥,因此根本不会被写入。
备份和还原整个注册表的最佳选择是使用系统还原(System Restore)。因此,在进行更改时,请先创建一个还原点(restore point),然后手动备份唯一编辑的部分。如果出现问题,您可以随时通过在Windows中双击.reg 文件(.reg file)来重新加载导出的部分。
如果您因为注册表更改(registry change)更严重地搞砸了某些事情而无法再进入Windows ,那么您可以简单地启动(Windows)高级恢复(Advanced Recovery)选项(Options)并选择您之前创建的还原点。(restore point)我将在下面详细(detail below)解释这两种方法。
打开注册表编辑器
首先,我们来谈谈打开注册表编辑器(registry editor)。在几乎所有最新版本的Windows中,您都可以通过单击“开始”按钮并输入(Start button and typing)regedit打开(regedit)注册表编辑器(registry editor)。
考虑到您在尝试学习如何备份注册表时发现了这篇文章,您可能已经知道如何执行此操作。显然,在对注册表进行任何更改之前,您应该始终对其进行备份。现在让我们来看看本文的重点,了解备份Windows 注册表(Windows registry)的不同方法。
Backup Parts/Sections注册表的备份部分/部分
在我的许多帖子中,我都提到了需要在注册表中编辑键或值的调整或提示。(key or value)如果您要在这里和那里进行一次更改,那么您实际上不需要备份整个注册表。
假设您正在编辑存储在以下键中的值:
HKEY_LOCAL_MACHINE – SOFTWARE – Microsoft – Windows – CurrentVersion – Explorer
您可以右键单击资源管理器(Explorer)并选择导出(Export) 以备份整个密钥以及所有子密钥及其任何值。
您会注意到在Explorer(Explorer key)主键下还有很多其他子键。默认情况下,只会导出选定的分支以及子键和值。如果要导出整个注册表,则必须在保存 .reg 文件时选择Export Range下的All 。
同样(Again),我不建议以这种方式备份整个注册表,因为在尝试重新导入文件时最终会出现 无法导入错误。( Cannot import)
因此,坚持只导出选定的分支,以后您将有更好的机会重新导入注册表文件(registry file)。现在让我们谈谈使用系统还原来(System Restore)执行注册表的完整备份。
(Backup Entire Registry)通过 系统还原(System Restore)备份整个注册表
使用系统还原(System Restore),您不会遇到还原到以前状态的问题,因为Windows会为您处理所有锁定和使用中的问题。在使用Windows时,您将始终创建一个还原点(restore point),这非常简单。
单击开始(Start)并输入创建还原点(Create restore point),然后单击第一个结果。您将被直接购买到“系统属性(System Properties)”对话框中的“系统保护”(System Protection)选项卡。
单击底部的创建(Create)按钮,将弹出另一个对话框询问描述。单击创建(Create)按钮,将创建还原点(restore point)。
创建还原点(restore point)应该只需要几分钟。完成后,您可以通过两种方式还原以前创建的还原点(restore point):通过 Windows 中的同一系统还原(System Restore) 对话框或通过“高级恢复选项(Advanced Recovery Options)”屏幕。我将在下面向您展示这两种方法。
通过 Windows 恢复注册表
如果您仍然能够启动Windows 并登录(Windows and log)到系统,那么您可以尝试通过打开系统(System Restore)还原来还原注册表。单击(Click)开始并输入(Start and type)系统还原,然后单击(system restore and click)第一个结果。
弹出“系统还原”对话框时,继续并单击(System Restore dialog)“下一步”(Next)。在以下屏幕上,您将看到系统上当前所有不同还原点的列表。
您将看到手动创建的还原点以及自动创建的还原点。您可以选中显示更多还原点( Show more restore points)框以查看系统上存储的所有还原点。如果您单击扫描受影响的程序(Scan for affected programs)按钮,它将为您提供在创建还原点(restore point)后安装的所有程序的列表,因为这些程序将被删除。它还会告诉您在创建还原点(restore point)后删除了哪些程序,这些程序将被还原。
单击下一步(Next)并完成(Finish),就是这样。系统将恢复到以前的还原点(restore point),您应该一切顺利。请注意,系统还原(System Restore)不会在更改系统状态时更改您的任何个人数据。它只查看注册表、程序和系统文件。
通过恢复(Recovery)选项(Options)恢复注册表(Registry)
如果您无法登录Windows,那么您仍然可以使用系统还原(system restore),但只能通过Windows 7 中的高级启动选项和(Advanced Boot Options)Windows 8和Windows 10中的高级恢复选项(Advanced Recovery Options)。这三种操作系统的方法略有不同,所以我将在下面解释它们。
Windows 7 恢复
对于Windows 7,您必须重新启动计算机,然后在初始启动期间按F8 键。(F8 key)这将打开Advanced Boot Options屏幕,第一个选项将是Repair Your Computer。
选择它并按Enter。这将加载系统恢复选项(e System Recovery Options)对话框,您需要在此处选择系统恢复(System Restore)。
同样,您只需选择要还原的还原即可。通常,如果您在加载Windows时遇到问题,高级启动选项屏幕(Advanced Boot Options screen)将自动出现。
请注意,如果您无法使用 F8 加载引导选项,则可能必须使用系统修复光盘(System Repair Disc)。您可以通过单击开始并输入(Start and typing)系统修复(system repair disc)光盘(repair disc)在任何Windows 7 PC 上创建修复光盘。
弹出 CD 或 DVD,然后单击创建光盘(Create disc)按钮。拥有此光盘后,您可以直接从它启动以获取上面显示的系统恢复(system recovery)选项。您唯一需要确保的是引导顺序首先列出了 CD/DVD ROM 驱动器。
Windows 8 恢复
在Windows 8中,整个恢复过程和 GUI(recovery procedure and GUI)完全不同。与以前枯燥的DOS 界面(DOS interface)不同,您现在拥有一个外观精美的现代GUI,这让事情变得容易多了。
F8 在尝试进入这个新界面时不再起作用。幸运(Luckily)的是,我已经写了一篇文章,介绍了您可以使用哪些不同方法进入Windows 8中的高级启动选项屏幕。进入主屏幕后,单击疑难解答(Troubleshoot)。
在疑难解答(Troubleshoot)部分下,继续并单击底部的高级选项。(Advanced options)
最后,单击最后一个屏幕上的系统还原(System Restore),您将看到熟悉的系统还原对话框,以选择要还原的还原点(restore point)。
在Windows 8中,您可以像在(Windows 8)Windows 7中一样创建系统修复(system repair)光盘,也可以创建 USB恢复驱动器(recovery drive)。要创建修复光盘(repair disc),请单击开始并键入(Start and type)recdisc.exe ,然后在恢复(recovery drive)驱动器中创建恢复驱动器类型(recovery drive type)。
同样,如果您无法在当前 PC 上加载恢复选项,则只需使用另一台计算机创建这些选项。
Windows 10 恢复
进入高级启动选项屏幕后, Windows 10(Windows 10)中的过程完全相同,但在Windows中略有不同。由于开始菜单在(Start Menu)Windows 10中恢复为完整形式,您可以单击它,然后单击设置(Settings)。
接下来,单击“设置”(Settings)对话框中的“更新和恢复”。( Update and recovery)如您所见,Windows 10中的(Windows 10)设置对话框(Settings dialog)与Windows 8(Windows 8)中的完全不同。
最后,您将能够单击Advanced startup下的(Advanced startup)Restart now按钮。这将使您进入相同的选择选项(Choose an option)屏幕,您将在其中单击疑难解答(Troubleshoot)。
希望以上详细说明可以让您在Windows 7(Windows 7)、Windows 8 和Windows 10中安全轻松地备份和恢复您的注册表。如果您有任何问题,请随时发表评论。享受!
Ultimate Guide to Backing Up and Restoring the Windows Registry
Windows stores just about еverything thаt makes it work in a hierarchal file-based database called the Wіndows Registry. The registry contains all the сonfiguration settings for the opеrating system, programs, services, components and pretty much everything else. Everything from the size of the icons to the color of the taskbar is stоred there.
The registry is made up of millions of keys and values. You can think of keys as folders and values as the data stored inside the folders. In the registry editor, keys actually look like folders and values are what hold the actual settings. Each key in the registry can have more than one value, kind of like a folder can have more than one file stored inside.
Also, values can store data of different types including String, Binary, DWORD, QWORD, and more. You don’t really need to understand that level of detail, but hopefully you understand the structure of the registry.
In terms of backing up the registry, you really have two options: backup parts of the registry manually via export or backup the entire registry using System Restore. When you make a change to the registry, it’s always a good idea to create a restore point and then backup the edited section of the registry also.
There is a way to export the entire registry, but that’s not a good option for several reasons. Firstly, you’re going to get a large file that you have to store somewhere. Secondly, if you’re only changing one setting, trying to import back the entire registry later on may overwrite many other newer values that were written to other parts of the registry after the export. This can actually lead more problems and possible corruption. Lastly, you may not even be able to import back the entire registry because a lot of keys will be in use by Windows and therefore simply won’t be written.
The best option to backup and restore the entire registry is to use System Restore. So when making a change, create a restore point first and then backup the only edited section manually. If there is a problem, you can always reload the exported section by simply double-clicking on the .reg file in Windows.
If you can’t get into Windows anymore because the registry change messed something up more severely, then you can simply start up the Advanced Recovery Options and choose the previous restore point you had created. I’ll explain both methods in detail below.
Opening Registry Editor
First, let’s talk about opening the registry editor. In just about every recent version of Windows, you can open the registry editor by clicking on the Start button and typing in regedit.
You probably already know how to do this considering you found this article while trying to learn how to backup the registry. Obviously, before you make any changes to the registry, you should always back it up. Now let’s get to the main point of this article on the different ways you can backup the Windows registry.
Backup Parts/Sections of the Registry
In many of my posts, I’ve mentioned tweaks or tips that require editing a key or value in the registry. If you’re going to be making a single change here and there, you don’t really need to backup the entire registry necessarily.
Let’s say you are editing a value stored at the following key:
HKEY_LOCAL_MACHINE – SOFTWARE – Microsoft – Windows – CurrentVersion – Explorer
You can right-click on Explorer and choose Export to make a backup of the entire key along with all sub-keys and any of their values.
You’ll notice that there are quite a few other sub-keys under the main Explorer key. By default, only the selected branch along with sub-keys and values will get exported. If you want to export the entire registry, you have to choose All under Export Range when saving the .reg file.
Again, I don’t recommend backing up the entire registry in this manner as you’ll end up getting a Cannot import error when trying to import the file back.
So stick with exporting only selected branches and you’ll have a better chance of being able to re-import the registry file later on. Now let’s talk about using System Restore to perform a full backup of the registry.
Backup Entire Registry via System Restore
Using System Restore, you won’t run into issues restoring to a previous state because Windows handles all the locked and in-use issues for you. You will always create a restore point while using Windows and it’s very simple to do.
Click on Start and type in Create restore point and click on the first result. You’ll be bought straight to the System Protection tab in the System Properties dialog.
Click on the Create button at the bottom and another dialog will pop up asking for a description. Click the Create button and the restore point will be created.
It should only take a few minutes to create the restore point. Once completed, you can restore a previously created restore point in two ways: via the same System Restore dialog in Windows or via the Advanced Recovery Options screen. I’ll show you both methods below.
Restore Registry via Windows
If you are still able to start Windows and log into the system, then you can try to restore the registry by opening System Restore. Click on Start and type in system restore and click on the first result.
When the System Restore dialog pops up, go ahead and click Next. On the following screen, you will see a list of all the different restore points currently on the system.
You will see the manually created restore points along with the automatically created ones too. You can check the Show more restore points box to see all the restore points stored on the system. If you click on the Scan for affected programs button, it will give you a list of any programs that were installed after the restore point was created since those will be removed. It will also tell you which programs were removed after the restore point was created that will be restored.
Click Next and Finish and that’s about it. The system will be reverted back to the previous restore point and you should be good to go. Note that System Restore does not alter any of your personal data when changing the state of the system. It only looks at the registry, programs and system files.
Restore Registry via Recovery Options
If you are not able to log into Windows, then you can still use system restore, but only via Advanced Boot Options in Windows 7 and Advanced Recovery Options in Windows 8 and Windows 10. The method is slightly different for all three operating systems, so I will explain them all below.
Windows 7 Recovery
For Windows 7, you have to restart your computer and then press the F8 key during the initial boot up. This will bring up the Advanced Boot Options screen and the first option there will be Repair Your Computer.
Select it and press Enter. This will load the System Recovery Options dialog and here you will need to choose System Restore.
Again, you just choose the restore you want to revert back to and that’s it. Normally, if you are having problems loading Windows, the Advanced Boot Options screen will appear automatically.
Note that if you are unable to load the boot options using F8, you may have to use a System Repair Disc. You can create a repair disc on any Windows 7 PC by clicking on Start and typing in system repair disc.
Pop in a CD or DVD and click the Create disc button. Once you have this disc, you can boot directly from it to get the system recovery options shown above. The only thing you need to ensure is that the boot order has the CD/DVD ROM drive listed first.
Windows 8 Recovery
In Windows 8, the entire recovery procedure and GUI is completely different. Instead of the boring DOS interface of before, you now have a fancy looking modern GUI, which makes things a lot easier.
F8 no longer works when trying to get to this new interface. Luckily, I’ve already written a post about the different methods you can use to get to the advanced boot options screen in Windows 8. Once you have gotten to the main screen, click on Troubleshoot.
Under the Troubleshoot section, go ahead and click on Advanced options at the bottom.
Finally, click on System Restore on the last screen and you’ll get the familiar system restore dialog to pick the restore point you want to revert back to.
In Windows 8, you can create a system repair disc like in Windows 7 or you can create a USB recovery drive. To create a repair disc, click on Start and type in recdisc.exe and to create the recovery drive type in recovery drive.
Again, you only need to create these using a different computer if you are not able to load the recovery options on your current PC.
Windows 10 Recovery
The procedure in Windows 10 is exactly the same once you get to the advanced boot options screen, but slightly different while in Windows. Since the Start Menu is back in full form in Windows 10, you can click on that and then click on Settings.
Next, click on Update and recovery in the Settings dialog. As you can see, the Settings dialog in Windows 10 is completely different than the one in Windows 8.
Finally, you’ll be able to click on the Restart now button under Advanced startup. This will get you to the same Choose an option screen where you will click Troubleshoot.
Hopefully, the detailed instructions above will allow you to safely and easily backup and restore your registry in Windows 7, Windows 8 and Windows 10. If you have any questions, feel free to post a comment. Enjoy!