用Windows自带的DISM命令清理被偷占的C盘空间

不知道你有没有遇到过这种情况:明明没装新软件,C盘空间却莫名其妙越来越小?最近我就碰到了这种问题。 开机后发现C盘可用空间比上次检查时少了整整5GB,这种"空间蒸发"现象让我有点不爽,于是我决定在问题恶化前稍微清理一番。

追踪消失的磁盘空间

首先需要找出磁盘空间是怎么被占用的。我用了一款叫WizTree的神器(强烈推荐!), 扫描结果显示C:\Windows文件夹占了34GB,其中光是C:\Windows\WinSxS目录就吃掉15GB。 在这里面,几个名为amd64_microsoft-edge-webview_xxxx的文件夹特别显眼。

出于谨慎,我咨询了Perplexity AI如何安全清理这些Edge相关文件。 AI警告不要手动删除WinSxS里的任何内容,并推荐了三个官方清理方法:

  • 磁盘清理工具
  • DISM命令
  • Storage Sense(存储感知,Win10/11专属)

这是当时的对话记录。 根据经验,磁盘清理效果有限,于是我选择了第二个方案------Windows内置的DISM命令行工具。

DISM命令

首先以管理员身份运行CMD,输入诊断命令:

yaml 复制代码
C:\>Dism.exe /online /Cleanup-Image /AnalyzeComponentStore

Deployment Image Servicing and Management tool
Version: 10.0.26100.1150

Image Version: 10.0.26100.4351

[==========================100.0%==========================]

Component Store (WinSxS) information:

Windows Explorer Reported Size of Component Store : 16.18 GB

Actual Size of Component Store : 15.39 GB

    Shared with Windows : 8.33 GB
    Backups and Disabled Features : 7.06 GB
    Cache and Temporary Data :  0 bytes

Date of Last Cleanup : 2025-07-02 02:02:19

Number of Reclaimable Packages : 4
Component Store Cleanup Recommended : Yes

The operation completed successfully.

结果显示WinSxS实际占用15.39GB(与WizTree扫描结果吻合), 其中Backups and Disabled Features(备份和禁用功能)占了7.06GB,系统建议立即清理。

接着执行标准清理:

makefile 复制代码
C:\>Dism.exe /online /Cleanup-Image /StartComponentCleanup

Deployment Image Servicing and Management tool  
Version: 10.0.26100.1150

Image Version: 10.0.26100.4351

[==========================100.0%==========================]  
The operation completed successfully.

虽然显示成功,但C盘空间纹丝未动。 于是按照AI建议,加上了更激进的/ResetBase参数(注意:这会删除所有旧版系统组件,无法回退系统更新):

makefile 复制代码
C:\>Dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase

Deployment Image Servicing and Management tool  
Version: 10.0.26100.1150

Image Version: 10.0.26100.4351

[==========================100.0%==========================]  
The operation completed successfully.

成果

再次用WizTree扫描发现:WinSxS目录从15GB瘦身到10GB,C盘可用空间从66GB回升到71GB! (不过章开头提到的WinSxS目录里的Edge相关文件其实并没有消失。) 通过复查命令确认:

yaml 复制代码
C:\>Dism.exe /online /Cleanup-Image /AnalyzeComponentStore

Deployment Image Servicing and Management tool  
Version: 10.0.26100.1150

Image Version: 10.0.26100.4351

[==========================100.0%==========================]

Component Store (WinSxS) information:

Windows Explorer Reported Size of Component Store : 11.18 GB

Actual Size of Component Store : 10.91 GB

    Shared with Windows : 8.30 GB  
    Backups and Disabled Features : 2.60 GB  
    Cache and Temporary Data :  0 bytes

Date of Last Cleanup : 2025-07-05 16:13:55

Number of Reclaimable Packages : 2  
Component Store Cleanup Recommended : Yes

The operation completed successfully.

备份和禁用功能部分从7GB锐减到2.6GB,效果立竿见影。

如果你的C盘可用空间也在悄悄缩水,不妨试试这个方案(再次提醒:使用/ResetBase后将无法撤销系统更新)。

相关推荐
许野平2 小时前
Rust:如何开发32位的DLL动态库
windows·rust·动态库·dll·32位
ChinaRainbowSea6 小时前
Windows 安装 RabbitMQ 消息队列超详细步骤(附加详细操作截屏)
java·服务器·windows·后端·rabbitmq·ruby
十五年专注C++开发6 小时前
vcpkg: 一款免费开源的C++包管理器
linux·开发语言·c++·windows·包管理器
Warren9811 小时前
Vue2博客项目笔记(第一天)
java·开发语言·javascript·vue.js·windows·笔记·ecmascript
jie*18 小时前
小杰数据结构——题库——拂衣便欲沧海去,但许明月随吾身
数据结构·windows·python
专注VB编程开发20年20 小时前
用ADO操作EXCEL文件创建表格,删除表格CREATE TABLE,DROP TABLE
服务器·windows·excel·ado·创建表格·删除表格·读写xlsx
梦魇星虹21 小时前
Dell电脑Windows系统更新后声卡驱动无法识别插线耳机问题
windows·电脑
许野平1 天前
Rust:如何开发Windows 动态链接库 DLL
windows·单片机·rust·dll·动态链接库
FreeDw资源库1 天前
Windows驱动更新下载工具,电脑硬件设备驱动程序自动安装下载更新,可备份还原!键盘鼠标声卡网卡显卡主板硬盘驱动都可以下载,免费使用的神器!
windows·计算机外设·驱动更新·驱动下载