# Windows 注册表

Windows 注册表（Windows Registry）是一个层次化数据库，Windows 操作系统、其应用程序和服务在其中存储对自身运行至关重要的配置数据。<sup>[1](https://learn.microsoft.com/windows/win32/sysinfo/structure-of-the-registry/)</sup>它以单一的、带类型的、树状结构的存储取代了早期 Windows 版本中分散的 INI 文件，程序通过标准 API 对其进行读写。<sup>[5](https://www.registryparser.com/en/blog/windows-registry-history)</sup><sup> • </sup><sup>[6](https://www.bitsavers.org/pdf/microsoft/windows_95/Introducing_Microsoft_Windows_95_1995.pdf)</sup>

| 关键事实 | 详情 |
|---|---|
| 结构 | 由项构成的层次结构，每个项可包含子项和称为“值”的数据条目；每个值有一个名称及关联数据<sup>[1](https://learn.microsoft.com/windows/win32/sysinfo/structure-of-the-registry/)</sup> |
| 首次出现 | Windows 3.1，发布于 1992 年<sup>[7](https://projectzero.google/2024/04/the-windows-registry-adventure-2.html)</sup> |
| 在 Windows 95 中的作用 | 用户、应用程序和计算机特定信息的中央配置存储，取代了 Windows 3.1 的 INI 文件<sup>[6](https://www.bitsavers.org/pdf/microsoft/windows_95/Introducing_Microsoft_Windows_95_1995.pdf)</sup> |
| 配置单元文件 | 在 Windows NT 4.0 至 Windows Vista 上，除 HKEY_CURRENT_USER 外所有配置单元的支持文件均存放于 `%SystemRoot%\System32\Config`<sup>[2](https://learn.microsoft.com/en-us/troubleshoot/windows-server/performance/windows-registry-advanced-users)</sup> |
| 64 位 Windows 上的 32 位 | 64 位注册表编辑器将 32 位项显示在 `HKEY_LOCAL_MACHINE\Software\WOW6432Node` 之下<sup>[2](https://learn.microsoft.com/en-us/troubleshoot/windows-server/performance/windows-registry-advanced-users)</sup> |
| 文件格式 | 专有二进制格式（基于 NT 的系统上为 regf），微软从未正式发布其规范<sup>[7](https://projectzero.google/2024/04/the-windows-registry-adventure-2.html)</sup><sup> • </sup><sup>[11](https://www.kandibrian.com/articles/windows-registry-forensic-analysis.html)</sup> |
| 编辑工具 | 注册表编辑器（regedit）、`reg` 命令行实用工具，以及 PowerShell——后者将配置单元呈现为 `HKCU:` 等驱动器<sup>[3](https://learn.microsoft.com/en-us/powershell/scripting/samples/working-with-registry-keys?view=powershell-7.6)</sup><sup> • </sup><sup>[9](https://learn.microsoft.com/th-th/windows/advanced-settings/developer-mode?view=aspnetcore-2.1)</sup> |

## 结构

注册表以树状组织。每个项既可包含子项，也可包含称为“值”的数据条目，而每个值由一个值名称及其关联数据（如有）组成。<sup>[1](https://learn.microsoft.com/windows/win32/sysinfo/structure-of-the-registry/)</sup>这棵树以少数几个顶级子树为根，例如用于全机设置的 HKEY_LOCAL_MACHINE 和用于已登录用户设置的 HKEY_CURRENT_USER。<sup>[2](https://learn.microsoft.com/en-us/troubleshoot/windows-server/performance/windows-registry-advanced-users)</sup><sup> • </sup><sup>[3](https://learn.microsoft.com/en-us/powershell/scripting/samples/working-with-registry-keys?view=powershell-7.6)</sup>

**配置单元。** 注册表配置单元（hive）是一组项、子项和值，配有一组包含其数据备份的支持文件。在 [Windows NT 4.0](https://www.edgepedia.org/zh/windows-nt-4-0)、[Windows 2000](https://www.edgepedia.org/zh/windows-2000)、[Windows XP](https://www.edgepedia.org/zh/windows-xp)、Windows Server 2003 和 Windows Vista 上，除 HKEY_CURRENT_USER 外所有配置单元的支持文件均存放于 `%SystemRoot%\System32\Config` 文件夹；例如，HKEY_LOCAL_MACHINE\SECURITY 的数据存储在文件 `\system32\config\security` 中。<sup>[2](https://learn.microsoft.com/en-us/troubleshoot/windows-server/performance/windows-registry-advanced-users)</sup><sup> • </sup><sup>[14](https://learn.ztu.edu.ua/pluginfile.php/413918/mod_resource/content/1/Windows%20Forensics%20Understand%20Analysis%20Techniques%20for%20Your%20Windows.pdf)</sup>

在 64 位版本的 Windows 上，默认的 64 位注册表编辑器将 32 位项显示在 `HKEY_LOCAL_MACHINE\Software\WOW6432Node` 节点之下，从而将 32 位应用程序的配置与其 64 位对应物分开。<sup>[2](https://learn.microsoft.com/en-us/troubleshoot/windows-server/performance/windows-registry-advanced-users)</sup>

## 历史

第一个自称“注册表”的东西出现在 1992 年发布的 [Windows 3.1](https://www.edgepedia.org/zh/windows-3-1) 中。

注册表在 20 世纪 90 年代的两次发布中达到了其可辨识的现代形态。[Windows 95](https://www.edgepedia.org/zh/windows-95) 将其用作面向用户、应用程序和计算机特定信息的中央配置存储——一个将全系统信息集中存放于单一位置的层次化数据库，取代了 Windows 3.1 中使用的 INI 文件。<sup>[6](https://www.bitsavers.org/pdf/microsoft/windows_95/Introducing_Microsoft_Windows_95_1995.pdf)</sup>与此同时，Windows NT 系列采用了 regf 文件格式：[Windows NT 3.1](https://www.edgepedia.org/zh/windows-nt-3-1) 的预发布版本使用 regf v1.0，Windows NT 3.1 正式版使用 regf v1.1，Windows NT 3.5 和 3.51 使用 regf v1.2。<sup>[7](https://projectzero.google/2024/04/the-windows-registry-adventure-2.html)</sup>

注册表的设计一举解决了 INI 文件时代的若干问题：带类型的值、按机器与按用户分离、内核可保持一致的存储，以及工具和管理员可共同面向的单一编程 API。<sup>[5](https://www.registryparser.com/en/blog/windows-registry-history)</sup>

## 编辑与管理

管理员和应用程序通过多种接口修改注册表。注册表编辑器（regedit）以图形方式显示项结构，是大多数用户会接触到的工具；`reg` 命令可直接添加值，例如 `reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowAllTrustedApps" /d "1"`。<sup>[9](https://learn.microsoft.com/th-th/windows/advanced-settings/developer-mode?view=aspnetcore-2.1)</sup>打包为 .reg 文件的设置可手动应用，也可通过登录脚本应用。<sup>[2](https://learn.microsoft.com/en-us/troubleshoot/windows-server/performance/windows-registry-advanced-users)</sup>

PowerShell 将注册表视为一组驱动器：`HKCU:` 对应 HKEY_CURRENT_USER 配置单元，`Get-ChildItem` 和 `Copy-Item` 等小命令可以列出、筛选和复制项。以这种方式复制的项不包含原项中所含的子项。<sup>[3](https://learn.microsoft.com/en-us/powershell/scripting/samples/working-with-registry-keys?view=powershell-7.6)</sup>

注册表编辑仍是 Windows 维护和故障排除的常规组成部分。微软针对近期版本发布的官方指南在规避已知问题时，会指引管理员前往 `HKLM\SYSTEM\CurrentControlSet\Control\Lsa\MachineIdentityIsolation` 等注册表路径，以及在 IT 管理的设备上前往用于[安全启动](https://www.edgepedia.org/zh/secure-boot)证书更新的注册表项。<sup>[4](https://support.microsoft.com/en-us/servicing/os/secure-boot/2025/09/registry-key-updates-for-secure-boot-windows-devices-with-it-managed-updates)</sup><sup> • </sup><sup>[8](https://learn.microsoft.com/windows/release-health/status-windows-11-26H2)</sup>

## 取证用途

由于注册表记录配置、用户活动和系统状态，配置单元文件是取证调查人员可用的最丰富的数据来源之一。分析涵盖用户活动、程序执行、USB 设备历史和恶意软件持久化机制。<sup>[11](https://www.kandibrian.com/articles/windows-registry-forensic-analysis.html)</sup>配置单元文件采用专有二进制格式，微软从未正式发布其规范，尽管通过 PDB 内核符号和独立的逆向工程努力，其结构实际上已公开。<sup>[11](https://www.kandibrian.com/articles/windows-registry-forensic-analysis.html)</sup>专用工具解析配置单元以提取取证痕迹和安全相关信息，<sup>[10](https://cursed.tools/docs/modules/windows/registry-hive-analyzer)</sup>而注册表数据是取证框架会检查的独立痕迹之一，用以与 Prefetch 和事件日志等来源相互印证。<sup>[12](https://github.com/Gear-I/Corrobora)</sup>注册表恢复也是用于取证软件基准测试框架的数字取证工具测试计划所界定的五个领域之一。<sup>[13](https://arxiv.org/abs/2512.16965)</sup>

## 备份行为

直至 [Windows 11](https://www.edgepedia.org/zh/windows-11) 版本 1803，每次成功启动都会促使系统在“RegBack”文件夹中自动保存一份注册表副本；当前版本不再执行此自动备份。<sup>[15](https://www.windowscentral.com/software-apps/windows-11/6-registry-tweaks-every-tech-savvy-user-must-apply-on-windows-11)</sup>

## References

1. [Structure of the Registry, Win32 apps, Microsoft Learn](https://learn.microsoft.com/windows/win32/sysinfo/structure-of-the-registry/)
2. [Windows registry for advanced users, Windows Server, Microsoft Learn](https://learn.microsoft.com/en-us/troubleshoot/windows-server/performance/windows-registry-advanced-users)
3. [Working with registry keys, PowerShell, Microsoft Learn](https://learn.microsoft.com/en-us/powershell/scripting/samples/working-with-registry-keys?view=powershell-7.6)
4. [Registry key updates for Secure Boot: Windows devices with IT-managed updates, Microsoft Support](https://support.microsoft.com/en-us/servicing/os/secure-boot/2025/09/registry-key-updates-for-secure-boot-windows-devices-with-it-managed-updates)
5. [A short history of the Windows Registry, and why it still matters, Registry Parser](https://www.registryparser.com/en/blog/windows-registry-history)
6. [Introducing Microsoft Windows 95 (1995), bitsavers](https://www.bitsavers.org/pdf/microsoft/windows_95/Introducing_Microsoft_Windows_95_1995.pdf)
7. [The Windows Registry Adventure #2: A brief history of the feature, Google Project Zero](https://projectzero.google/2024/04/the-windows-registry-adventure-2.html)
8. [Windows 11, version 26H2 known issues and notifications, Microsoft Learn](https://learn.microsoft.com/windows/release-health/status-windows-11-26H2)
9. [Settings for developers, Microsoft Learn](https://learn.microsoft.com/th-th/windows/advanced-settings/developer-mode?view=aspnetcore-2.1)
10. [Registry Hive Analyzer, Cursed Tools](https://cursed.tools/docs/modules/windows/registry-hive-analyzer)
11. [Windows Registry Forensic Analysis: User Activity, Execution, USB, and Persistence, Kandi Brian](https://www.kandibrian.com/articles/windows-registry-forensic-analysis.html)
12. [Corrobora: Open-source Windows forensics framework, GitHub](https://github.com/Gear-I/Corrobora)
13. [AutoDFBench 1.0: A Benchmarking Framework for Digital Forensic Tool Testing, arXiv](https://arxiv.org/abs/2512.16965)
14. [Windows Forensics: Understand Analysis Techniques, ZTU](https://learn.ztu.edu.ua/pluginfile.php/413918/mod_resource/content/1/Windows%20Forensics%20Understand%20Analysis%20Techniques%20for%20Your%20Windows.pdf)
15. [6 registry tweaks every tech-savvy user must apply on Windows 11, Windows Central](https://www.windowscentral.com/software-apps/windows-11/6-registry-tweaks-every-tech-savvy-user-must-apply-on-windows-11)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 17, 2026; Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 软件与编程 › Operating systems › Microsoft Windows

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/windows-registry

English original: https://www.edgepedia.org/windows-registry
