Disk Cleanup Command Line !exclusive! →
cleanmgr /sagerun:1 You must first run cleanmgr /sageset:1 to configure which file types to delete. That setting is then reused by /sagerun:1 . Target a Specific Drive To analyze or clean a specific drive (e.g., D:):
del /q /f /s "%TEMP%\*" del /q /f /s "C:\Windows\Temp\*" vssadmin delete shadows /all /quiet Save as cleanup.bat and run as Admin: disk cleanup command line
cleanmgr /d D: If the drive is critically low on space, you can force a more aggressive cleanup: cleanmgr /sagerun:1 You must first run cleanmgr /sageset:1
cleanmgr /autoclean /d C: For deeper control, combine with standard commands: combine with standard commands: