用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 小时前
电脑上如何查看WiFi密码
windows·电脑
xiaocao_10237 小时前
支持在Windows电脑上使用的日程待办清单工具都有哪些?
windows
两圆相切7 小时前
Windows API 介绍及核心函数分类表
windows
.m9 小时前
无法打开windows安全中心解决方案
windows
Top`9 小时前
Java 泛型 (Generics)
java·开发语言·windows
九流下半10 小时前
window wsl 环境下编译openharmony,HarmonyOS 三方库 FFmpeg
windows·ffmpeg·harmonyos·编译·openharmony·三方库
brave_zhao12 小时前
JavaBeanUtils javaBean转map, 实体类转map,实体集合转List<Map>
linux·windows·python
chilavert31819 小时前
技术演进中的开发沉思-31 MFC系列:类层次结构
c++·windows