<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>系统清理 on 一页笔记</title><link>https://blog.qion7.tech/tags/%E7%B3%BB%E7%BB%9F%E6%B8%85%E7%90%86/</link><description>Recent content in 系统清理 on 一页笔记</description><generator>Hugo</generator><language>zh-Hans-CN</language><lastBuildDate>Wed, 02 Dec 2026 00:30:00 +0800</lastBuildDate><atom:link href="https://blog.qion7.tech/tags/%E7%B3%BB%E7%BB%9F%E6%B8%85%E7%90%86/index.xml" rel="self" type="application/rss+xml"/><item><title>Windows C 盘深度清理实战：看懂实际占用、找出隐藏大头与防膨胀</title><link>https://blog.qion7.tech/posts/windows-c-drive-cleanup/</link><pubDate>Wed, 02 Dec 2026 00:30:00 +0800</pubDate><guid>https://blog.qion7.tech/posts/windows-c-drive-cleanup/</guid><description>一次从 24.5 GiB 释放到 100+ GiB 的真实 Windows C 盘清理复盘：为什么普通扫描会漏掉十几个 GB、哪些目录绝对不能手删，以及怎么解决删不掉的残留 DLL。</description><content:encoded><![CDATA[<p>Windows 用久了，C 盘飘红几乎是每个人的必经之路。但多数人清理 C 盘时容易走两个极端：要么只点一下“磁盘清理”清出几百 MB，要么对着网上的“一键脚本”把 <code>WinSxS</code> 或 <code>Installer</code> 瞎删一通导致系统更新彻底坏掉。</p>
<p>下面是一套在实机上跑通的分层清理方法——那次完整走下来，C 盘真实可用空间直接涨了 <strong>80+ GiB</strong>，而且没有动任何个人资料、浏览器数据和开发存档。</p>
<div class="article-metrics">
  <div class="article-metric">
    <span class="article-metric-value">+83.5 GiB</span>
    <span class="article-metric-label">一次完整分层清理净增可用空间</span>
  </div>
  <div class="article-metric">
    <span class="article-metric-value">13.48 GB</span>
    <span class="article-metric-label">普通权限扫描漏掉的 SystemTemp 占用</span>
  </div>
  <div class="article-metric">
    <span class="article-metric-value">0 损坏</span>
    <span class="article-metric-label">个人资料、WSL 与系统组件完整保留</span>
  </div>
</div>
<h2 id="清理前先纠偏别被逻辑大小骗了">清理前先纠偏：别被“逻辑大小”骗了</h2>
<p>很多人看空间占用，习惯右键文件夹看“大小（Size）”。在 Windows 的 NTFS 分区里，这是个大坑。</p>
<p>微软商店应用、Xbox 游戏、WSL 虚拟磁盘经常用到**稀疏文件（Sparse File）**或硬链接。逻辑大小可能显示占了 30 GB，实际落盘可能只占几个 GB；反过来，有些系统保护目录在普通用户权限下根本统计不到。</p>
<p>判断空间只信三个数字：</p>
<ul>
<li><strong>WizTree（管理员权限扫描 MFT）的 <code>Allocated</code>（实际分配空间）</strong>；</li>
<li><code>fsutil volume diskfree C:</code> 的卷空闲字节数；</li>
<li>清理前后同一台机器上的实时 <code>Get-PSDrive C</code> 差值。</li>
</ul>
<div class="article-callout">
  <div class="article-callout-title">实用小细节：管理员 MFT 扫描的差额</div>
  <p>普通权限递归扫描目录时，会静默跳过很多系统受保护路径。用管理员权限直接读 NTFS 主文件表（MFT）做全盘盘点，能一眼看到隐藏大头——实测里光是 <code>C:\Windows\SystemTemp</code> 就悄悄吃掉了 13.48 GB，之前浅层扫描根本看不见。</p>
</div>
<h2 id="分层清理的正确顺序">分层清理的正确顺序</h2>
<p>不要一上来就开删系统目录，按风险从低到高分四层推进最稳妥：</p>
<ol class="article-steps">
  <li>
    <span class="article-step-num">1</span>
    <div>
      <strong>先建基线，再盘点</strong>
      记录清理前的可用空间，再用管理员 MFT 扫描全盘，同时检查卷影副本（VSS）和 WinSxS 组件存储分析报告。
    </div>
  </li>
  <li>
    <span class="article-step-num">2</span>
    <div>
      <strong>清可重建缓存与明确超期临时文件</strong>
      优先清理包管理器缓存、过期安装包，以及 <code>C:\Windows\SystemTemp</code>、<code>C:\Windows\Temp</code> 中超过 7 天的旧临时文件（保留最近几天正在被更新程序使用的文件）。
    </div>
  </li>
  <li>
    <span class="article-step-num">3</span>
    <div>
      <strong>应用与开发组件走官方管理器</strong>
      长期不用的游戏和软件走正规卸载后再清残留；Visual Studio 不用的工作负载（例如移动端/UWP）通过官方 Installer 的 <code>setup.exe modify --remove</code> 移除，千万别手删 Packages 子目录。
    </div>
  </li>
  <li>
    <span class="article-step-num">4</span>
    <div>
      <strong>最后处理系统组件与虚拟磁盘回收</strong>
      用官方 <code>DISM</code> 清理 WinSxS 过期更新，给 WSL2 开启稀疏磁盘并执行 <code>fstrim</code> 回收空间。
    </div>
  </li>
</ol>
<h2 id="实测最容易踩的四个坑">实测最容易踩的四个坑</h2>
<div class="article-cards">
  <section class="article-card">
    <h3>1. vssadmin 参数组合坑</h3>
    <p>删除指定卷影副本时，<code>/shadow={ID}</code> 和 <code>/for=C:</code> 不能同时传，否则直接报退出码 2。删前先用 WMI 核对 ID 确实属于 C 盘，再只传 <code>/shadow</code> 执行。</p>
  </section>
  <section class="article-card">
    <h3>2. 删不掉的残留 DLL 不一定是权限问题</h3>
    <p>部分网盘或工具卸载后，右键菜单扩展 DLL 会被 <code>explorer.exe</code> 持续占用，连管理员都删不掉。先用 Restart Manager 查清锁定进程，短暂重启资源管理器即可顺手删掉，不用乱改 ACL。</p>
  </section>
  <section class="article-card">
    <h3>3. 卸载器偷偷卡在隐藏窗口</h3>
    <p>部分 Inno/NSIS 卸载器会释放 <code>_iu*.tmp</code> 或 <code>Un_*.exe</code> 后停在无交互的隐藏进程里。批量处理时要设超时并查进程树，避免无限死等。</p>
  </section>
  <section class="article-card">
    <h3>4. WinSxS 清理别随手加 /ResetBase</h3>
    <p>用 <code>DISM /Online /Cleanup-Image /StartComponentCleanup</code> 就够安全了；加上 <code>/ResetBase</code> 会导致已安装的累计更新无法卸载，日常清理不建议默认带它。</p>
  </section>
</div>
<h2 id="哪些能清哪些绝对别碰">哪些能清、哪些绝对别碰</h2>
<div class="article-table-wrap">
<table>
	<thead>
			<tr>
					<th>区域</th>
					<th>推荐处理方式</th>
					<th>说明</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td><code>C:\Windows\SystemTemp</code> / <code>Temp</code></td>
					<td>按 7 天阈值清理旧文件</td>
					<td>保留近 7 天，避免误删正在进行的驱动或系统更新缓存</td>
			</tr>
			<tr>
					<td>WinSxS 组件存储</td>
					<td><code>DISM /StartComponentCleanup</code></td>
					<td>走官方命令，严禁手动删除目录内文件</td>
			</tr>
			<tr>
					<td>Visual Studio 工作负载</td>
					<td>Visual Studio Installer CLI</td>
					<td>严禁手动删 <code>ProgramData\Microsoft\VisualStudio\Packages</code></td>
			</tr>
			<tr>
					<td>卷影副本（VSS）</td>
					<td>先看“已使用”而非“最大配额”</td>
					<td>已使用仅几百 MB 时保留还原点，不必清零</td>
			</tr>
			<tr>
					<td><code>Windows\Installer</code> / <code>WindowsApps</code></td>
					<td><strong>严禁手删</strong></td>
					<td>删除会直接破坏已安装程序的修复与卸载链路</td>
			</tr>
			<tr>
					<td>NTFS <code>$MFT</code> / <code>$LogFile</code> / 休眠与分页</td>
					<td><strong>严禁手删</strong></td>
					<td>属于文件系统与内存管理核心结构</td>
			</tr>
	</tbody>
</table>
</div>
<div class="article-callout is-warn">
  <div class="article-callout-title">防膨胀比“猛清一次”更重要</div>
  <p>清理完如果不改源头，两三个月 C 盘又会涨回来。最有效的三件事是：把大型开发缓存与模型/工具目录挪到数据盘、给 WSL2 虚拟磁盘开启 <code>sparseVhd=true</code> 自动回收、以及在后台驱动/系统更新跑完后二次核对可用空间。</p>
</div>
<details class="article-details">
  <summary>展开：清理前后的系统保护区核验命令（PowerShell 管理员）</summary>
  <p>在动手前和清理后各跑一次这几条命令，用来做前后对比和验证：</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-powershell" data-lang="powershell"><span style="display:flex;"><span>Get-PSDrive C
</span></span><span style="display:flex;"><span>fsutil volume diskfree C:
</span></span><span style="display:flex;"><span>vssadmin list shadowstorage /<span style="color:#66d9ef">for</span>=C:
</span></span><span style="display:flex;"><span>DISM /Online /Cleanup-Image /AnalyzeComponentStore /English
</span></span></code></pre></div></details>
]]></content:encoded></item></channel></rss>