Safe C: Drive Cleanup
Paste the following prompt into your AI chat to install this skill:
Please follow https://skillhub.cn/install/skillhub.md to install @user_c1ee5550/safe-c-drive-cleanup.
About this skill
Problem
When Windows C: drive runs low on space, manual deletion can damage pagefile.sys, WinSxS, System32, or user data. This skill separates cleanup into read-only scanning, scope confirmation, and recoverable removal to reduce accidental deletion.
Workflow
- Scan: uses Python
os.walkto generate a Markdown report, bucketing top-level and second-level directory sizes, listing files of100 MBor larger, and skipping symlinks to avoid runaway traversal. - Confirm: proposes safe candidates such as
Temp, updater caches,Windows.edb, and old backups, while explicitly excluding core system paths and user data; requires explicit multi-select confirmation before removal. - Execute: calls
SHFileOperationWwithFOF_ALLOWUNDOto send selected files to the Recycle Bin instead of permanent deletion; processes paths in small batches and skips locked files with reporting. - Special cases: if
Windows.edbis locked by Windows Search, it can stopWSearch, recycle the file, then restart and verify the service;pagefile.sysis never touched.
Boundaries and Notes
The skill relies on a specific command form to work around sandbox restrictions on protected paths, requiring Windows paths in single quotes with literal backslashes. It only moves files to the Recycle Bin; actual space is reclaimed only after the user explicitly confirms emptying it.
Use Cases
- C: drive is low on space; generate a read-only report before confirming cleanup targets.
- Remove Temp, updater caches, and old backups to the Recycle Bin without permanent deletion.
- Handle locked Windows.edb by checking Windows Search status before safe cleanup.
- Avoid touching pagefile.sys, WinSxS, System32, or user data during C: cleanup.
Best For
- IT engineers maintaining Windows test machines need to free C: space while keeping files recoverable.
- Developers running local toolchains need to clear caches and old backups without losing config.
- Ops engineers taking over Windows hosts need read-only scanning and per-item confirmation.
- Windows developers need to handle locked Windows.edb and temp files safely.
Related Skills
For independent developers, automates Git weekly reports, prioritized bug tickets, and project health checks into shareable Markdown.
Scan Windows caches, temporary files, and junk files, show space usage and risk levels, and clean selected items to free disk space.
Deploy a WeChat Service Account backend with Hermes AI, Nginx, systemd, and an admin dashboard on an Ubuntu/Debian VM.
Covers Jenkins, GitHub, and automation-related wrap workflows for IT operations and security.