<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Windows on 🐟🐟🐟🐟🐟🐟🐟🐟🐟🐟🐟🐟</title>
    <link>https://fps.ink/tags/windows/</link>
    <description>Recent content from 🐟🐟🐟🐟🐟🐟🐟🐟🐟🐟🐟🐟</description>
    <generator>Hugo</generator>
    <language>zh-cn</language>
    
    <managingEditor>xxx@example.com (Jarvis)</managingEditor>
    <webMaster>xxx@example.com (Jarvis)</webMaster>
    
    <copyright>本博客所有文章除特别声明外，均采用 BY-NC-SA 许可协议。转载请注明出处！</copyright>
    
    <lastBuildDate>Sun, 14 May 2023 22:31:00 +0800</lastBuildDate>
    
    
    <atom:link href="https://fps.ink/tags/windows/index.xml" rel="self" type="application/rss&#43;xml" />
    

    
    

    <item>
      <title>Windows 注册表完全指南</title>
      <link>https://fps.ink/post/windows-registry/</link>
      <pubDate>Sun, 14 May 2023 22:31:00 &#43;0800</pubDate>
      <author>xxx@example.com (Jarvis)</author>
      <guid>https://fps.ink/post/windows-registry/</guid>
      <description>
        <![CDATA[<h1>Windows 注册表完全指南</h1><p>作者：Jarvis（xxx@example.com）</p>
        
          <p>注册表是 Windows 的「中枢配置数据库」：系统设置、软件配置、文件关联、开机启动、服务参数几乎都在里面。本文从结构讲到常用路径、命令行操作、备份恢复和风险控制，附一批可以直接用的改法。</p>
<h2 id="一它是什么">
<a class="header-anchor" href="#%e4%b8%80%e5%ae%83%e6%98%af%e4%bb%80%e4%b9%88"></a>
一、它是什么
</h2><ul>
<li>逻辑上是一个<strong>树形数据库</strong>，运行时由内核加载到内存（<code>ntoskrnl</code> 负责），读写非常快；</li>
<li>物理上落盘为若干 <strong>hive 文件</strong>，主要存放在 <code>C:\Windows\System32\config\</code> 和每个用户的 <code>NTUSER.DAT</code>；</li>
<li>与 INI 文件不同，注册表支持二进制值、权限控制、事务日志（<code>.LOG1/.LOG2</code>）。</li>
</ul>
<blockquote>
<p>32 位程序访问时会被重定向到 <code>WOW6432Node</code>，下面会讲。</p>
</blockquote>
<h2 id="二五个根键">
<a class="header-anchor" href="#%e4%ba%8c%e4%ba%94%e4%b8%aa%e6%a0%b9%e9%94%ae"></a>
二、五个根键
</h2><table>
	<thead>
			<tr>
					<th>根键</th>
					<th>含义</th>
					<th>对应 hive 文件</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td><code>HKEY_CLASSES_ROOT</code>（HKCR）</td>
					<td>文件关联、COM 注册</td>
					<td>由 HKLM\SOFTWARE\Classes 与 HKCU\Software\Classes 合并而成</td>
			</tr>
			<tr>
					<td><code>HKEY_CURRENT_USER</code>（HKCU）</td>
					<td>当前用户配置</td>
					<td><code>C:\Users\&lt;用户&gt;\NTUSER.DAT</code></td>
			</tr>
			<tr>
					<td><code>HKEY_LOCAL_MACHINE</code>（HKLM）</td>
					<td>本机全局配置</td>
					<td><code>System32\config\SYSTEM</code> <code>SOFTWARE</code> <code>SAM</code> <code>SECURITY</code></td>
			</tr>
			<tr>
					<td><code>HKEY_USERS</code>（HKU）</td>
					<td>所有用户配置集合</td>
					<td>各用户 NTUSER.DAT + <code>DEFAULT</code></td>
			</tr>
			<tr>
					<td><code>HKEY_CURRENT_CONFIG</code>（HKCC）</td>
					<td>当前硬件配置</td>
					<td>由 <code>SYSTEM</code> 中 CurrentControlSet\Hardware Profiles 派生</td>
			</tr>
	</tbody>
</table>
<p>常用缩写：<code>HKLM</code>、<code>HKCU</code> 在命令行里可直接用。</p>
<h2 id="三结构项值类型">
<a class="header-anchor" href="#%e4%b8%89%e7%bb%93%e6%9e%84%e9%a1%b9%e5%80%bc%e7%b1%bb%e5%9e%8b"></a>
三、结构：项、值、类型
</h2><pre tabindex="0"><code>HKEY_CURRENT_USER
└─ Software                     ← 项（Key）
   └─ Microsoft
      └─ Windows
         └─ CurrentVersion
            ├─ (默认)          ← 值项（Value），名称为空
            ├─ Wallpaper       ← REG_SZ
            └─ NoDesktop       ← REG_DWORD
</code></pre><p>数据类型：</p>
        
        <hr><p>本文2023-05-14首发于<a href='https://fps.ink/'>🐟🐟🐟🐟🐟🐟🐟🐟🐟🐟🐟🐟</a>，最后修改于2023-05-14</p>]]>
      </description>
      
        <category>技术</category>
      
    </item>
    
  </channel>
</rss>
