Windows Disk Cleanup Cmd
Note: /sagerun requires prior /sageset configuration run interactively once.
Run as Administrator for full effect.
Create a batch script cleanup.bat :
These two switches are the "secret sauce" for automating disk cleanup. They allow you to create a "profile" of what to delete and then run it whenever you want without further interaction. Step 1: Create a Preset Profile (/sageset) windows disk cleanup cmd
Windows 10/11 includes automatic Disk Cleanup via Storage Sense, but command-line control is limited. Alternative: Use cleanmgr /verylowdisk (Windows 10+): cleanmgr /d C ).
cleanmgr /d (e.g., cleanmgr /d C ).