无论你走到哪里,你都会发现有人告诉每个人都远离注册表(Registry)。虽然我在一定程度上同意这一点,但我已经意识到,无论我们是否知道,我们所做的很多事情都涉及到注册表。(Registry)如果您希望在某个时候自定义您的Windows操作系统,您将不得不处理Registry。如果您是新手,您可能想阅读这篇关于Windows 注册表基础(Windows Registry Basics)的文章- 但请记住,这篇文章是为高级用户准备的,并且必须始终在触摸注册表之前对其进行备份。
Windows注册表编辑器提示(Registry Editor Tips)和功能
如果您不喜欢在Registry上乱搞,那么我绝不会说您应该弄乱它。如果您是喜欢自定义Windows 操作系统(Windows Operating System)的用户,那么事实是,无论您是手动进行还是使用一些免费软件程序进行自定义,这一切都与注册表(Registry)有关,并且是不可避免的。
我希望这份与注册表(Registry)一起使用的提示列表将减轻您的不适并使其更易于管理。但请记住,如果您不确定,最好远离它。
访问或打开 Windows 注册表
Windows 注册表文件位于system32 /config 文件夹中,但您当然需要使用名为Regedit的内置注册表编辑实用程序来处理您可以通过以下位置访问的注册表:(Registry)
- 点击Start Button > Run >输入Regedit并点击回车。
- 打开Task Manager > File > New Task >键入Regedit并按 Enter。
- 在命令提示符(Command Prompt)中键入Regedit并按 Enter。
提示(TIP):Windows 11/10的用户 可以使用地址栏直接跳转到任何注册表项或更改字体。
创建桌面快捷方式以打开 Windows 注册表(Windows Registry)
如果您愿意,可以通过执行以下操作将桌面快捷方式添加到Regedit :
- 右键单击(Right-click)桌面上的空白区域,按新建(New),然后按快捷方式(Shortcut)。对于位置(Location),键入Regedit单击下一步并为您的(Regedit)快捷方式(Shortcut)选择一个名称,最后单击完成(Finish)。
阅读(Read):如何在注册表编辑器中快速切换 HKLM 和 HKCU
带有 .reg 扩展名的文件
下载了一个扩展名为 .reg 的文件,但您不确定它可以做什么?右键单击该文件并选择在记事本中(Notepad)编辑(Edit)或打开(Open),您将能够看到它将操作的注册表项的位置。(Registry)
例如,以下 .reg 文件在记事本(Notepad)中打开时将如下所示,其中位置以粗体显示,值在下方。
[HKEY_CURRENT_USER\Software\Microsoft\InternetExplorer\Main\WindowsSearch]
"Version"="6.1.7600.16385"
"User Favorites Path"="file:///C:\\Users\\Lee\\Favorites\\"
"UpgradeTime"=hex:fe,27,f3,41,02,91,cc,01
"ConfiguredScopes"=dword:00000005
"LastCrawl"=hex:3e,26,a3,a1,cd,90,cc,01
"Cleared"=dword:00000001
"Cleared_TIMESTAMP"=hex:23,9d,94,80,24,48,cc,01
如果您不确定 .reg 文件的用途,您可以随时复制该位置并在线搜索它。
阅读(Read):如何在 Windows 中为其他用户编辑注册表。
在触摸Windows 注册表之前进行备份(Windows Registry)
如果您在Regedit中工作,您可以轻松完成许多事情,以避免弄乱注册表(Registry)。
- 在对注册表(Registry)进行更改之前,始终建议先快速创建一个系统还原点,因为这将使您能够返回到更改之前的状态。
- 如果您想创建注册表项的备份(create a backup of a Registry key )或导出(Export)键以与其他人共享,请右键单击(Right-Click)键并选择导出(Export),选择名称并添加.reg作为格式。您还可以使用免费软件Regback或ERUNTgui备份注册表(Registry)。
阅读(Read):Windows 注册表路径中使用了表情符号;你知道吗!?
Windows 注册表(Windows Registry)中的更改、添加(Add)、重命名键(Rename keys)
- 如果要更改(change)注册表(Registry)项的设置,可以通过双击要更改的值并添加所需的更改来轻松完成。
- 重命名(Renaming) 注册表(Registry)键:您只需右键单击(Right-Click)键或值并选择重命名。
- 添加(Add)键右键单击(Right-Click)要添加为子键的键并选择New Key,与值相同。
阅读(Read):注册表编辑器无法打开、崩溃或停止工作。(Registry Editor not opening, crashing or stopped working.)
获得注册表项的所有权
如果您发现自己试图操作注册表(Registry)项并收到您无权执行的错误,请右键单击(error)注册表(Registry)项并选择权限(Permissions)。10 次中有 9 次执行此操作时,您需要先取得注册表项的(Registry)所有权(Ownership),然后再授予自己提升的权限。要取得所有权(Ownership),当您在注册表(Registry)项属性窗口中时,单击Advanced\Owner,如果未列出您的用户名,请选择其他用户或组(Groups)并在文本框中输入您的用户名。接下来单击检查名称(Check Names)以确保您输入了正确的用户名。单击确定(Click OK),然后您可以更改权限。了解有关如何完全拥有注册表项的(take full ownership of registry keys)更多信息。
需要注意的一点:如果您计划恢复所有权和权限,请首先注意原始所有者和权限。以下是在其他用户或组中选择所有者时使用的默认所有者列表:
- 受信任的安装程序:输入NT SERVICE\TrustedInstaller,单击检查名称,然后单击确定。
- 系统:输入系统,(System,)单击检查名称(Check Names),然后单击确定。
- 管理员:输入管理员(Administrators),单击检查名称,然后单击确定。
- 您的用户名:输入您的用户(Your Username)名,单击检查名称,然后单击确定。
- 用户:输入用户(Users),单击检查名称,然后单击确定。
阅读(Read): 何时保存对注册表的更改?
将注册表项添加到收藏夹
我喜欢 Regedit 的一个功能是收藏夹(Favorites)。由于我倾向于在注册表(Registry)中的相同区域内进行大量工作,因此将键添加到收藏夹有助于快速获取这些键。
要将注册表(Registry)项添加到收藏夹(Favorites),只需选择一个键以转到顶部菜单并选择Favorites\Add添加到收藏夹(Favorites)。
完成后,您将在收藏夹下看到一个条目,您只需在希望转到该注册表(Registry)项时单击该条目。
如果您知道要查找的注册表(Registry)项并且不希望单击Regedit,请选择 Edit > Find并键入位置以快速导航到注册表(Registry)项。
阅读:(Read:) 如何在 Windows 中创建注册表项。
使用命令提示符(Command Prompt)操作注册表
如果您更喜欢在命令提示符(Command Prompt)下工作,可以使用以下命令来处理注册表:
- Reg add :向(Reg add)注册表(Registry)添加新的子项或条目。
- Reg compare:比较指定的注册表子项或条目。
- Reg copy:将一个子项复制到另一个子项。
- Reg delete :从(Reg delete)注册表(Registry)中删除子项或条目。
- Reg export:将指定的子项、条目和值的副本创建到REG(文本)格式的文件中。
- 注册表导入(Reg import):将包含导出的注册表(Registry)子项、条目和值的REG文件合并到注册表(Registry)中。
- Reg load:将保存的子项和配置单元格式的条目写回不同的子项。
- Reg 查询(Reg query):显示子键或值中的数据。
- Reg restore:将保存的子项和条目以 hive 格式写回注册表(Registry)。
- Reg save :以 hive(二进制)格式保存注册表(Registry)的指定子项、条目和值的副本。
- Reg unload:删除使用 reg load 加载的注册表部分。(Registry)
Example: Reg query HKLM\Software will list all the subkeys
如果您在命令提示符中输入Reg /?它将列出可用的命令。
Windows中还有其他一些内置命令行(Command Line)工具可供更高级的用户使用,例如Regini, 但我将把它们留到另一篇文章中,并将其保留为基本使用。顺便说一句,如果您想知道Windows 注册表(Windows Registry)文件在磁盘上的位置,请到这里(here)查找!
读:(Read:)
- 如何在 Windows 中打开多个注册表实例
- 如何比较或合并注册表文件(How to Compare or Merge Registry files)
- 如何监控注册表的更改(How to monitor changes to the Registry)
- 如何搜索 Windows 注册表项、值和设置。
无需大量知识的用户即可轻松处理注册表项的工具:(Tools to make handling Registry keys easy, for users, without a lot of knowledge:)
RegOwnit
SetACL
Registrar Registry Manager
提示(TIP):了解如何在不使用 regedit.exe 的情况下编辑Windows 注册表(Windows Registry)- 而是在 Windows 11/10 中使用 Reg.exe
Registry Editor: Use, Edit, Open, Modify, Save, Backup, Import, Export
Everywhere you turn you find someone telling evеrуone to stаy clear of the Registrу. While I agree with this to an extent, I have come to realize that a lot of what we dо іnvolves the Registry whether we know it or not. If you’re looking to customize your Windows Opеrаting System at sоme point, you are going to have to deal with the Registry. If you are a noviсe, you may want to read this post on Windows Registry Basics – but do remember that this post is meant for advanced users, and one must always back up the Registry before touching it.
Windows Registry Editor Tips & Features
If you are uncomfortable messing around the Registry, then I would never say that you should mess with it. If your a user who loves to customize your Windows Operating System then the truth is, whether you do it manually or use some freeware program to customize with – it all deals with the Registry and is unavoidable.
This list of tips to work with the Registry, I hope, will ease your discomfort some and make it a little bit easier to manage. But remember, if you are unsure, its best to stay away from it.
Access or open the Windows Registry
The Windows Registry files are located in the system32/config folder, but you, of course, need to use the built-in registry editing utility called Regedit to handle Registry which you can access by the following locations:
- Hit the Start Button > Run > type Regedit and hit enter.
- Open the Task Manager > File > New Task > type Regedit and hit enter.
- In a Command Prompt type Regedit and hit enter.
TIP: Users of Windows 11/10 can use the Address Bar to jump directly to any registry key or change the Font.
Create a desktop shortcut to open Windows Registry
If you prefer you can add a shortcut to the desktop to Regedit by doing the following:
- Right-click a blank area on the desktop, press New and then press Shortcut. For Location, type Regedit click next and choose a name for your Shortcut and finally click Finish.
Read: How to switch between HKLM and HKCU quickly in Registry Editor
Files with .reg extension
Downloaded a file with the extension .reg but you are unsure of what it may do? Right-click the file and select Edit or Open in Notepad and you will be able to see the location of the Registry key it will manipulate.
For example, the following .reg file when opened in Notepad will look like the following with the location in bold and values underneath.
[HKEY_CURRENT_USER\Software\Microsoft\InternetExplorer\Main\WindowsSearch]
"Version"="6.1.7600.16385"
"User Favorites Path"="file:///C:\\Users\\Lee\\Favorites\\"
"UpgradeTime"=hex:fe,27,f3,41,02,91,cc,01
"ConfiguredScopes"=dword:00000005
"LastCrawl"=hex:3e,26,a3,a1,cd,90,cc,01
"Cleared"=dword:00000001
"Cleared_TIMESTAMP"=hex:23,9d,94,80,24,48,cc,01
If you are unsure of what the .reg file is going to do, you can always copy the location and search online for it.
Read: How to edit Registry for another User in Windows.
Backup before touching the Windows Registry
If you are working in Regedit, there are a number of things you can do easily, to avoid messing up with the Registry.
- Before making changes to the Registry, it is always recommended to quickly create a System Restore Point first, as this will enable you to return to the previous state before you did changes.
- If you would like to create a backup of a Registry key or Export the key for sharing with someone else, Right-Click the key and select Export, choose a name and add .reg as the format. You can also back up the Registry using freeware Regback or ERUNTgui.
Read: Emojis are being used in the Windows Registry path; Did you know!?
Change, Add, Rename keys in Windows Registry
- If you want to change settings to a Registry key, you can do so easily by Double-Clicking the value you wish to change and add the changes you wish.
- Renaming Registry keys: You need only Right-Click the key or value and select rename.
- To Add a key Right-Click the key you wish to add as a subkey and select New Key, the same with values.
Read: Registry Editor not opening, crashing or stopped working.
Take ownership of Registry keys
If you find yourself trying to manipulate a Registry key and get an error that you do not have permission to do, Right-Click the Registry key and select Permissions. 9 out of 10 times when you do this you will need to Take Ownership of the Registry key first before giving yourself elevated permissions. To Take Ownership, while you are in the Registry key properties window, click Advanced\Owner and if your username is not listed select Other Users or Groups and enter your username in the text box. Next click Check Names to make sure you have entered the correct username. Click OK and then you can change permissions. Learn more about how to take full ownership of registry keys.
One thing to note: If you plan on restoring ownership and permissions, take note first of the original owner and permissions. The following is the default owners list to use when selecting an owner in Other Users or Groups:
- Trusted Installer: Type in NT SERVICE\TrustedInstaller, click Check Names then click OK.
- System: Type in System, click Check Names and then click OK.
- Administrators: Type in Administrators, click Check Names then click OK.
- Your Username: Tye in Your Username, click Check Names then click OK.
- Users: Type in Users, click Check Names then click OK.
Read: When do changes to the Registry get saved?
Add Registry keys to Favorites
One feature I like with Regedit is Favorites. As I tend to work a lot within the same areas in the Registry, adding the keys to Favorites helps to get to these keys quickly.
To add a Registry key to Favorites, simply select a key to go to the top menu and select Favorites\Add to Favorites.
Once done you will see an entry under Favorites that you need only click when you wish to go to that Registry key.
If you know the Registry key you are looking for and do not wish to click through Regedit, select Edit > Find and type the location to quickly navigate to the Registry key.
Read: How to create a Registry Key in Windows.
Using Command Prompt to manipulate the Registry
If you are more comfortable working in a Command Prompt, the following commands can be used to handle the Registry:
- Reg add : Adds a new subkey or entry to the Registry.
- Reg compare : Compares specified registry subkeys or entries.
- Reg copy : Copies a subkey to another subkey.
- Reg delete : Deletes a subkey or entries from the Registry.
- Reg export : Creates a copy of specified subkeys, entries, and values into a file in REG (text) format.
- Reg import : Merges a REG file containing exported Registry subkeys, entries, and values into the Registry.
- Reg load : Writes saved subkeys and entries in hive format back to a different subkey.
- Reg query : Displays the data in a subkey or a value.
- Reg restore : Writes saved subkeys and entries in hive format back to the Registry.
- Reg save : Saves a copy of specified subkeys, entries, and values of the Registry in hive (binary) format.
- Reg unload : Removes a section of the Registry that was loaded using reg load.
Example: Reg query HKLM\Software will list all the subkeys
In a Command Prompt if you type in Reg /? It will list the available commands.
There are several other built-in Command Line tools in Windows for more advanced users as well such as Regini, but I’ll leave those to another post and keep this for basic use. By the way, if you have wondered where the Windows Registry files are located on the disk, go here to find out!
Read:
- How to open multiple instances of the Registry in Windows
- How to Compare or Merge Registry files
- How to monitor changes to the Registry
- How to search Windows Registry Keys, Values and Settings.
Tools to make handling Registry keys easy, for users, without a lot of knowledge:
RegOwnit
SetACL
Registrar Registry Manager
TIP: See how you can edit Windows Registry without using regedit.exe – but instead by using Reg.exe in Windows 11/10