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

相关推荐
路由侠内网穿透7 小时前
本地部署 GPS 跟踪系统 Traccar 并实现外部访问
运维·服务器·网络·windows·tcp/ip
研华嵌入式14 小时前
如何在高通跃龙QCS6490 Arm架构上使用Windows 11 IoT企业版?
arm开发·windows·嵌入式硬件
带娃的IT创业者19 小时前
Windows 平台上基于 MCP 构建“文心一言+彩云天气”服务实战
人工智能·windows·文心一言·mcp
csdn_aspnet21 小时前
Windows Node.js 安装及环境配置详细教程
windows·node.js
摇滚侠21 小时前
java语言中,list<String>转成字符串,逗号分割;List<Integer>转字符串,逗号分割
java·windows·list
Source.Liu21 小时前
【Pywinauto库】12.2 pywinauto.element_info 后端内部实施模块
windows·python·自动化
Source.Liu21 小时前
【Pywinauto库】12.1 pywinauto.backend 后端内部实施模块
开发语言·windows·python·自动化
私人珍藏库1 天前
[Windows] FileOptimizer v17.1.0_一款文件批量压缩工具
windows·批量压缩
掘根1 天前
【CMake】List
windows·microsoft·list
TToolss1 天前
删除文件夹里的网盘图标
windows