Disk Cleanup (cleanmgr)
Run: cleanmgr.exe
Overview
Frees disk space by identifying and deleting safe-to-remove files: temporary files, old Windows Update packages, Recycle Bin contents, downloaded program files, thumbnails, and more. Run as administrator to unlock system-level cleanup options.
Run as Administrator
Right-click cleanmgr → Run as administrator → click "Clean up system files" button. This adds high-value categories:
- Windows Update Cleanup — old update packages no longer needed (can free 1–10+ GB)
- Previous Windows Installations — old Windows.old folder after an OS upgrade (can free 15–30 GB)
Scriptable / Automated Cleanup
# Configure cleanup options interactively, save to registry slot 1:
cleanmgr /sageset:1
# Run saved configuration silently (use in scripts, Task Scheduler):
cleanmgr /sagerun:1
Advanced: DISM WinSxS Cleanup
For maximum space recovery on the component store — irreversible:
# Compress and clean component store (cannot be undone):
DISM /online /Cleanup-Image /StartComponentCleanup /ResetBase
Warning: after /ResetBase, Windows Update rollback for currently installed updates is no longer possible.
Alternative Methods
Settings path: Settings → System → Storage → Temporary files (Windows 10/11 modern UI)
# PowerShell — delete user temp files:
Remove-Item $env:TEMP\* -Recurse -Force -ErrorAction SilentlyContinue
# Clear Windows temp:
Remove-Item C:\Windows\Temp\* -Recurse -Force -ErrorAction SilentlyContinue
IT Notes
Schedule cleanmgr /sagerun:1 via Task Scheduler on workstations to automatically reclaim space. Useful for VDI environments and machines with small SSDs.