Temporary files pile up over time: old installers, update caches, error reports. They can take up tens of GB. You can delete them safely, with a few exceptions.
Method 1: Settings → Storage
Settings → System → Storage → Temporary files. Windows calculates what it can delete and shows you the size of each category. Check what you want and click Remove files.
- Safe to delete: Temporary files, Windows Update Cleanup, Delivery Optimization Files, Thumbnails
- Watch out for “Downloads”: it deletes your entire Downloads folder
- Watch out for “Recycle Bin”: it empties the Recycle Bin permanently
Method 2: The %temp% folder
Press Win+R, type %temp%, and press Enter. Select everything (Ctrl+A) and delete it. Files in use by open programs can't be deleted: click Skip, that's normal.
Method 3: Disk Cleanup
Search Start for “Disk Cleanup”, choose C:, and click “Clean up system files”. This also shows old Windows installations (“Previous Windows installation”), which can take up over 20 GB after a major update. Once you delete them, you can no longer go back to the previous version.
Automatic: Storage Sense
Settings → System → Storage → Storage Sense. Turn it on and Windows automatically deletes temporary files and, optionally, old content in the Recycle Bin and Downloads.
How to clear the Windows Update cache (the SoftwareDistribution folder)
When an update gets stuck or the Windows Update download folder has grown a lot, you can empty it manually. Open Terminal as Administrator and stop the services first:
- net stop wuauserv
- net stop bits
- Delete the contents of C:\Windows\SoftwareDistribution\Download (only the contents, not the folder)
- net start bits
- net start wuauserv
- The next time it checks for updates, Windows downloads again only what it's missing. Your installed update history isn't lost
Disk Cleanup from the command line: cleanmgr
You can also start Disk Cleanup from Win+R. The command cleanmgr /d C: opens the scan for the C: drive directly.
You can save a selection and run it anytime. Run cleanmgr /sageset:1, check the categories you want and click OK. Then cleanmgr /sagerun:1 cleans exactly the same categories, with no prompts. It's handy if you want to clean up regularly from a shortcut.
There is also a system temp folder: C:\Windows\Temp. You can empty it the same way as %temp%, but you need administrator rights.
The “Clean up system files” list also includes error reports (“System created Windows Error Reporting Files”) and update log files. They're safe to delete if your PC is working fine. If you have an unresolved problem and want to investigate it, keep them until you fix it.
What you should NOT delete manually from Windows
Some large folders look useless, but deleting them manually breaks the system. Use the right tool for each one.
- C:\Windows\Installer: without it, you can no longer repair or uninstall some programs
- C:\Windows\WinSxS: only clean it with the command DISM /Online /Cleanup-Image /StartComponentCleanup, run as Administrator
- pagefile.sys: this is the paging file; it's managed from System Properties → Advanced → Performance → Virtual memory
- hiberfil.sys: only goes away with powercfg /hibernate off. Note: this also turns off both hibernation and Fast Startup
- C:\Windows\Prefetch: Windows uses it to launch programs faster; it gets rebuilt anyway
How to see what's taking up space on C:
Settings → System → Storage shows which categories take up your disk. Click “Show more categories” for the full list: apps, system files, documents, pictures, and more.
In Windows 11 there are also “Cleanup recommendations”, on the same page. It shows you large files, apps you haven't used in a long time, and files already synced to the cloud that you can free up locally.
If you use OneDrive, right-click a synced folder → “Free up space”. The files stay in the cloud and are downloaded again only when you open them.
The “System & reserved” category can be large. It includes restore points, the hibernation file, and virtual memory. You can reduce the space for restore points in System Properties → System Protection → Configure, but don't set it to zero: you need at least one restore point before making changes.
Games take up the most space. In Steam or another launcher you can see the size of each game and move them to another drive from the library settings, without downloading them again.
How often to clean up
Once a month is enough for most PCs. Storage Sense can do it automatically. Daily cleaning adds nothing: temp files are recreated as soon as you use your programs.
Clear your browser cache from the browser itself, with Ctrl+Shift+Delete. Don't clear it often: sites load more slowly until it rebuilds, and some will sign you out. Only clear it when a site displays incorrectly or when it takes up a lot of space. Likewise, clear the cache of chat or streaming apps from each app's settings.
On an SSD, always leave free space. A nearly full SSD writes more slowly, and Windows no longer has room for updates. You can also clean temp files and caches with the ApexOptimize Deep Cleaner module.
Everything automatic, in one click
ApexOptimize Pro applies the steps above for you, with automatic backup and Undo for every change. The Standard version is free, and Basic starts at €2.49 per month.
Frequently asked questions
Is it safe to delete everything in the Temp folder?
Yes. Programs that need a temporary file keep it open, and Windows won't let you delete it. The rest are leftovers that nothing uses anymore.
Can I delete the Windows.old folder?
Yes, through Disk Cleanup → Clean up system files → Previous Windows installation. Don't delete it manually in File Explorer. Once it's deleted, you can no longer go back to the previous version of Windows.
Should I clear the shader cache?
Only if a game has graphics problems after a driver update. Otherwise, the cache helps: without it, games stutter until they rebuild it.
Why does the Temp folder fill up again after I empty it?
Because programs write there while they work: installs, updates, previews. That's normal behavior. It only matters if the folder grows to many GB, a sign that a program isn't cleaning up after itself.
Does deleting temporary files increase FPS in games?
Not directly. Temp files aren't read while you play. Cleaning them only helps if the drive was nearly full, because a full drive slows down the whole system and updates.
Can I delete the WinSxS folder to free up space?
No. WinSxS holds Windows components, and many files in it are just links, so it doesn't take up as much space as it seems. For a safe cleanup, run DISM /Online /Cleanup-Image /StartComponentCleanup as Administrator.
Is it safe to disable hibernation to save space?
Yes, if you don't use hibernation. The command powercfg /hibernate off deletes hiberfil.sys, which can be several GB. But you'll also lose Fast Startup, so booting after Shut down may be a bit slower.