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

相关推荐
木心术13 小时前
Windows系统下MySQL与AI工具集成方案:数据存储与调用实践
人工智能·windows·mysql
beyond阿亮3 小时前
Hermes Agent快速接入 QQ 完整教程|QQ聊天使用AI智能体
人工智能·windows·ai·openclaw·hermes agent
DONSEE广东东信智能读卡器4 小时前
用PowerShell实现Windows 本地 WSS/HTTPS 自签名证书配置方法
windows·网络协议·https·powershell·身份证阅读器
DogDaoDao7 小时前
Windows 下 Git 报错:`touch` 无法识别 —— 原因分析与 7 种解决方案(从入门到精通)
windows·git·程序员·npm·powershell·cmd·touch
Ai.den8 小时前
Windows 安装 MinerU 3.x 实现本地批量解析 PDF
人工智能·windows·ai
xfddlm8 小时前
在Windows上配置Claude Code
windows
AI行业学习8 小时前
Notepad++ 下载+安装+插件集合 完整教程(Windows,安全无捆绑)
windows·notepad++
__zRainy__9 小时前
uni-app 全局容器实战系列(二):Vite 虚拟模块
windows·uni-app
Omics Pro9 小时前
前沿学科:量子生物学!
大数据·数据库·人工智能·windows·redis·量子计算
IceSugarJJ10 小时前
Windows下VSCode+ WSL项目启动流程
linux·windows·vscode·ubuntu·wsl