Clean C Drive
Use scripts/Invoke-CDriveCleanup.ps1 for deterministic scanning and cleanup. Read references/cleanup-experience.md when diagnosing a sudden refill or explaining why a directory was preserved.
Workflow
-
Run a read-only scan first:
powershell -NoProfile -ExecutionPolicy Bypass -File scripts\Invoke-CDriveCleanup.ps1 -Mode Scan -DeepScan -
Report the largest reclaimable cache paths separately from protected application or user data.
-
Run user-level cleanup only after the user asks to clean:
powershell -NoProfile -ExecutionPolicy Bypass -File scripts\Invoke-CDriveCleanup.ps1 -Mode Clean -
Run full cleanup when the user authorizes system cleanup. This cleans user caches, requests UAC, clears locked system caches, and runs DISM component cleanup:
powershell -NoProfile -ExecutionPolicy Bypass -File scripts\Invoke-CDriveCleanup.ps1 -Mode Full -
Add
-IncludeRecycleBinonly when the user explicitly authorizes emptying it. Add-DisableHibernationonly when the user explicitly asks to disable hibernation. -
Verify final free space, remaining locked paths, hibernation status, and any services temporarily stopped by cleanup.
Safety Rules
- Never delete personal folders, project directories, browser profiles, installed programs, game libraries, or cloud-sync data automatically.
- Never manually delete
pagefile.sys, restore points,WinSxS,Installer, orSystem32content. - Do not use
DISM /ResetBase; useStartComponentCleanupso installed updates remain serviceable. - Preserve package installations such as roaming npm global tools, WinGet packages, Godot export templates, and Feishu version directories unless the user separately confirms removal.
- Treat failures as locked or permission-protected items. Report them instead of broadening deletion scope.
- Do not clear Prefetch as routine cleanup; Windows manages it and rebuilding it can slow startup.
- Do not create junctions or move caches to another drive during cleanup unless the user separately requests migration.
Modes
Scan: Read-only known-cache inventory and protected-data summary.Clean: Remove whitelisted user-level caches and temporary files.AdminClean: Run only the elevated system-cleaning stage.Full: RunClean, then self-elevate forAdminClean.
Use -WhatIf with a cleaning mode to preview deletion targets without changing files.