Windows 磁盘清理操作清单 / Windows disk clean-up checklist

Date:

Author:


本文列出在 Windows 下为释放系统盘空间可检查的事项(含部分软件开发工具的可清理内容),各项说明以 Windows 10 中的操作为准。

This post lists various checkable items for releasing system disk space on Windows, including cleanable contents of some software development tools. The operations are based on Windows 10.

1. Windows 操作系统

1.1. 系统文件

转到「设置(Settings)→系统(System)→存储(Storage)→临时文件(Temporary files)」,按需清理。

启动「开始(Start)→Windows 管理工具(Windows Administrative Tools)→磁盘清理(Disk Clean-up)」,选择「清理系统文件(Clean up system files)」。

注 1:清理内容涉及系统更新时较耗时。
注 2:可能存在无法清理的内容。

1.2. 页面文件

检查 pagefile.sys 的位置和大小,转到「设置(Settings)→系统(System)→关于(About)→高级系统设置(Advanced system settings)→高级(Advanced)→性能(Performance)→高级(Advanced)→虚拟内存(Virtual memory)」修改配置。

1.3. 休眠功能

<System drive>:/hiberfil.sys 无法移动,可考虑关闭休眠功能。执行如下操作:

powercfg -h off

powercfg /hibernate off

注:需管理员权限。

1.4. Windows 搜索

检查搜索数据库(位于 <ProgramData>\Microsoft\Search\Data\Applications\Windows\,Windows 10 中名为 Windows.edb,Windows 11 中名为 Windows.db)的大小(一般用户无访问权限,可通过 Everything 等搜索工具查看),转到「设置(Settings)→搜索(Search)→搜索 Windows(Searching Windows)→高级搜索索引器设置(Advanced Search Indexing Settings)或「控制面板(Control Panel)→索引选项(Indexing Options)」并执行操作:

  • 重建数据库:在「高级(Advanced)→疑难解答(Troubleshooting)→重建(Rebuild)」中操作(后台执行,非常耗时);
  • 更改数据库位置:在「高级(Advanced)→索引位置(Index location)」中操作。

可指定索引文件夹:在「索引选项(Indexing Options)→修改(Modify)」或「设置(Settings)→搜索(Search)→搜索 Windows(Searching Windows)→排除的文件夹(Excluded Folders)」中操作。

可关闭搜索功能:转到「计算机管理(Computer Management)→服务和应用程序(Services and Applications)→服务(Services)→Windows Search」操作。

1.5. Windows 功能

转到「控制面板(Control Panel)→程序(Programs)→程序和功能(Programs and Features)→启用或关闭 Windows 功能(Turn Windows features on or off)」,按需删除功能。

注 1:不要随意清理 Windows 功能,以免影响正常使用;
注 2:重启操作系统后生效;
注 3:重启后,「设置(Settings)→应用(Apps)→应用和功能(Apps & features)→可选功能(Optional features)」中可能仍会列出已删除的功能(如 Internet Explorer 11、Windows Media Player),可忽略或在此再选择删除。

2. 应用程序

2.1. 内存转储文件

搜索 .dmp 文件并删除。

注:删除位于 <Windows>\System32\*\CrashDumps\ 和 <Windows>\SysWOW64\*\CrashDumps\ 中的 .dmp 文件时需管理员权限。

2.2. 应用程序的无效补丁

为清理 <Windows>\Installer\ 中的无效文件,可安装 HomeDev/PatchCleaner,谨慎移出(或清理)孤立文件(orphaned files)。

2.3. Visual Assist X 插件

以用于 Visual Studio 2015 的 Visual Assist X 插件为例,检查 <User>\AppData\Local\Microsoft\VisualStudio\14.0\Extensions\<RandomName>\Data\ 的大小,在 Visual Studio 中转到「VAssistX→Visual Assist Options→Performance」并执行操作:

  • Clear 用于清理缓存;
  • Rebuild 用于重建数据库(重启 Visual Studio 后执行,耗时,会导致软件无响应)。

2.4. PyCharm

清理缓存:在 PyCharm 中转到「Files -> Invalidate Caches…」。

清理旧版本:<User>\AppData\Local\JetBrains\ 下旧版本所在目录可直接删除。

2.5. 微信

以通过 Microsoft Store 安装的微信为例,收取文件的存储位置为 <User>\AppData\Roaming\Tencent\WeChatAppStore\WeChatAppStore Files\<WeChat ID>\Files\,在此按需删除文件。

3. 其他说明

3.1. 查看磁盘占用情况

安装 WinDirStat 查看空间占用情况,用于辅助磁盘清理操作。

注:不要随意删除文件,应当仅在充分了解文件用途的前提下通过专门工具操作。

3.2. 系统清理软件

安装 CCleaner 免费版,常用操作有:

  • Custom Clean 用于清理系统与应用程序的缓存等;
  • Registry 用于清理注册表;
  • 「Tools→Startup」用于管理系统启动项、计划任务、快捷菜单、系统服务。

注:不要随意清理,应当仅在充分了解所列选项的前提下操作。


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.