用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后将无法撤销系统更新)。

相关推荐
dust_and_stars1 小时前
ubuntu24使用apt安装VS-code-server code-server
linux·服务器·windows
梦星辰.1 小时前
超大 JSONL 数据集交互式查看器 Linux便捷工具
linux·windows·microsoft
取个名字太难了a2 小时前
插入APC
windows
非凡ghost4 小时前
ImageConverter(图像转换编辑工具)
图像处理·人工智能·windows·学习·计算机视觉·软件需求
洛克大航海4 小时前
Python 在系统 Windows 和 Ubuntu 中创建虚拟环境
windows·python·ubuntu·虚拟环境
ZEERO~4 小时前
@dataclass的作用
开发语言·windows·python
雪域迷影4 小时前
Windows11上安装Redis服务和Redis可视化客户端
windows·redis
广然4 小时前
Windows 11 关闭 VBS 的几种方法
windows·ensp·vbs
不染尘.5 小时前
Linux基本概述
linux·windows·centos·ssh
郑泰科技5 小时前
快速地图匹配(FMM)的开源工具与代码示例
c++·windows·python·交通物流