Disk Cleanup
7 cleanup tasks that safely free disk space without affecting system stability. All operations are safe but not reversible (Recycle Bin already emptied, etc.), so review each task before running.
Temporary Files
Removes files from %TEMP% and Windows\Temp folders. These are created by apps and Windows during normal operation and are safe to delete.
%TEMP%\* and %WINDIR%\Temp\*
Remove-Item -Recurse -Force "$env:TEMP\*"; Remove-Item -Recurse -Force "$env:WINDIR\Temp\*"
Recycle Bin
Empties the Recycle Bin on all drives, permanently deleting files that were previously sent to the Recycle Bin.
All drives
Clear-RecycleBin -Force
Prefetch Files
Deletes prefetch files (.pf) in Windows\Prefetch. These files speed up app startup but can accumulate over time. Safe to delete — Windows will rebuild them as needed.
%WINDIR%\Prefetch\*
Remove-Item -Force "$env:WINDIR\Prefetch\*"
Windows Update Cache
Clears the SoftwareDistribution\Download folder where Windows stores downloaded update files. Windows Update service is stopped/restarted automatically.
%WINDIR%\SoftwareDistribution\Download\*
net stop wuauserv; net stop bits; Remove-Item -Recurse -Force "$env:WINDIR\SoftwareDistribution\Download\*"; net start wuauserv; net start bits
Thumbnail Cache
Deletes Explorer thumbnail cache files (thumbcache_*.db). These caches speed up thumbnail display in folders with images but can grow large over time.
%LOCALAPPDATA%\Microsoft\Windows\Explorer\thumbcache_*
Remove-Item -Force "$env:LOCALAPPDATA\Microsoft\Windows\Explorer\thumbcache_*"
DNS Cache
Flushes the DNS resolver cache (ipconfig /flushdns). This forces Windows to re-resolve domain names, fixing connectivity issues and clearing outdated entries.
In-memory cache
ipconfig /flushdns
Memory Dumps
Deletes MEMORY.DMP (kernel memory dump) and Minidump files. Created after BSOD crashes and can be very large. Safe to delete after diagnosing crash issues.
%WINDIR%\MEMORY.DMP and %WINDIR%\Minidump\*
Remove-Item -Force "$env:WINDIR\MEMORY.DMP"; Remove-Item -Force "$env:WINDIR\Minidump\*"