Knowledge Base →8 min readUpdated: 2026-09-20

How to Delete Temporary Files in Windows 10 and 11

Windows keeps temporary data in several distinct places, and only some of them are safe to empty by hand: %TEMP% and C:\Windows\Temp always are, Windows.old and Delivery Optimization are safe with one caveat each, and Prefetch is safe but pointless. The built-in path is Settings → System → Storage → Temporary files, with Disk Cleanup's “Clean up system files” button reaching what Settings hides.

The folders that are genuinely temporary

Windows has two temp folders, not one. The per-user folder resolves from %TEMP% and normally points at C:\Users\<you>\AppData\Local\Temp — paste %TEMP% into the Explorer address bar to open it directly. The system folder is C:\Windows\Temp and belongs to services and installers running with system privileges. Both are working scratch space: installers unpack there, applications write crash dumps and intermediate files there, and almost nobody cleans up after themselves.

Anything in either folder can be deleted, with one qualification: files currently open by a running process will refuse to delete, and that is the system protecting you rather than an error to work around. Select everything, press Delete, click “Skip” on whatever is locked, and move on. Nothing that a program genuinely needs after a reboot is stored there — the folders are documented as volatile, and both are wiped by many installers anyway.

On a machine that has been in daily use for a year or two, the pair usually holds anywhere from a few hundred megabytes to several gigabytes. Installers for large applications are the biggest contributors: graphics driver packages alone unpack a gigabyte or more and frequently leave it behind, often under C:\AMD or C:\NVIDIA rather than in Temp at all — worth checking while you are in the neighbourhood.

The built-in tools: Storage settings and Disk Cleanup

Settings → System → Storage → Temporary files gives a categorized list with a size next to each entry and a checkbox. It covers the Recycle Bin, Downloads (unticked by default and worth leaving that way — those are your files, not junk), Windows Update cleanup, Delivery Optimization files, thumbnails, and the temp folders themselves. The main advantage over manual deletion is that it knows about categories Explorer cannot see.

The classic Disk Cleanup still exists and still reaches further. Run cleanmgr, pick the drive, then click “Clean up system files” — that button re-launches the tool elevated and unlocks Windows Update Cleanup, previous Windows installations, and the servicing leftovers that the normal view hides. For a repeatable setup, cleanmgr /sageset:1 opens a full checklist that saves your choices to the registry, and cleanmgr /sagerun:1 then runs exactly that selection silently, which is what you put in a scheduled task.

  • Win+R → %TEMP% — the per-user temp folder
  • Win+R → C:\Windows\Temp — the system temp folder
  • Settings → System → Storage → Temporary files — the categorized list
  • cleanmgr → Clean up system files — update and servicing leftovers
  • cleanmgr /sageset:1 then /sagerun:1 — a saved, repeatable selection
  • Dism.exe /Online /Cleanup-Image /StartComponentCleanup — the supported WinSxS trim

Windows.old: 10–30 GB, and what you give up

After a feature update or an in-place upgrade, Windows moves the previous installation to C:\Windows.old. It is genuinely large — typically 10–30 GB depending on how much was installed — and it exists for exactly one purpose: the “Go back” button in Settings → System → Recovery, which returns you to the previous Windows version if the new one broke something.

That rollback window is short. Windows deletes Windows.old automatically about ten days after the upgrade, and once it is gone, “Go back” is gone with it. So the decision is simple: if the machine has been stable since the update and you are past the first week, remove it; if you are still finding problems, leave it until you are sure. Delete it through Disk Cleanup's “Previous Windows installation(s)” entry or the Storage settings page — never by dragging the folder to the Recycle Bin, because its permissions will fight you and a partial delete leaves unusable remains.

Two related folders show up in the same cleanup lists. $WINDOWS.~BT and $WINDOWS.~WS are staging folders for an upgrade that is in progress or was abandoned; they are safe to remove through Disk Cleanup once no upgrade is pending, and they sometimes account for several gigabytes on a machine where an update failed repeatedly.

Prefetch and SuperFetch: safe to delete, mostly pointless

C:\Windows\Prefetch holds small .pf files that record which pages of code an application touched during its first seconds, so Windows can read them in one go next time. The whole folder is typically under a few hundred megabytes and is capped by Windows itself at a fixed number of entries. Deleting it is harmless — Windows rebuilds an entry the next time each program runs — but it frees almost nothing and makes the first launch of each program marginally slower until the data is rebuilt.

The advice to “clean Prefetch regularly” is a holdover from spinning-disk, low-RAM machines and has no measurable benefit today. There is one legitimate reason to clear it: after removing malware or an uninstalled program, the .pf entries keep referencing paths that no longer exist, and some diagnostic workflows prefer a clean slate. Outside of that, leave it alone. The same reasoning applies to the ReadyBoot trace under Prefetch\ReadyBoot, which feeds boot optimization.

Update leftovers: SoftwareDistribution and Delivery Optimization

C:\Windows\SoftwareDistribution\Download is where Windows Update stages packages before installing them. Once an update is installed the contents are dead weight, and on a machine that has run through several cumulative updates this folder often holds several gigabytes. Clearing it is supported but has an order: stop the services first with net stop wuauserv and net stop bits from an elevated prompt, delete the contents of the Download folder, then start both services again. Deleting it while the service is running is how download queues end up corrupted.

C:\Windows\SoftwareDistribution\DataStore holds the update history database. Deleting it is also non-fatal, but it erases your installed-update history and forces a full re-scan against Windows Update, which takes a while and is rarely worth it. Leave DataStore alone unless you are following a specific repair procedure for a stuck update.

Delivery Optimization files live in C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Microsoft\Windows\DeliveryOptimization and are the peer-to-peer cache of update pieces. They are safe to remove and frequently account for several gigabytes, but remove them through the Storage settings entry rather than by hand — the folder's permissions are restrictive by design, and the supported path clears the associated bookkeeping too.

What you must not delete

The list of things that look like junk and are not is short but important. WinSxS is the biggest trap: C:\Windows\WinSxS often reports 8–15 GB in Explorer, but most of that is hard links to files that already exist elsewhere in Windows, so the real cost is far smaller and deleting anything inside it breaks servicing permanently. The only supported way to shrink it is Dism.exe /Online /Cleanup-Image /StartComponentCleanup, optionally with /ResetBase to drop the ability to uninstall existing updates.

  • C:\Windows\WinSxS — the component store; use DISM, never manual deletion
  • pagefile.sys and swapfile.sys — virtual memory; resize via System settings only
  • hiberfil.sys — hibernation image; remove with powercfg /h off if you never hibernate
  • System Volume Information — restore points and shadow copies; manage via System Protection
  • C:\Windows\System32 and \SysWOW64 — never, under any description of “temporary”
  • %APPDATA% (Roaming) — application settings and profiles, not temporary data
  • C:\ProgramData\<vendor> — licence files and databases for installed software

Keeping it from coming back

Storage Sense automates the boring half of this. Settings → System → Storage → Storage Sense lets you run cleanup on a schedule or when free space runs low, empty the Recycle Bin after a chosen number of days, and delete files that have sat in Downloads untouched for a set period. Enable the first two; think twice about the Downloads rule, because it deletes real files that you merely have not opened recently.

What Storage Sense does not do is reach into application caches, browser profiles, leftover installer folders on the root of C:, or the temp folders of other Windows accounts — it is deliberately conservative. That gap is where a dedicated cleaner is useful: Kleaner PRO's Deep Cleaner lists those categories with the full path of every file it proposes to remove, so you approve the list rather than trusting a checkbox, and its scheduler repeats the pass so temp data never grows into a space problem again.

Questions and Answers

Is it safe to delete everything in the Temp folder?

Yes. Files still in use by a running program will refuse to delete and should simply be skipped — nothing in %TEMP% or C:\Windows\Temp needs to survive a reboot.

How much space do temporary files usually take?

On a machine in daily use for a year or two, expect a few hundred megabytes to several gigabytes across the temp folders, plus far more if Windows.old or Delivery Optimization files are present.

Can I delete Windows.old right after upgrading?

You can, but you lose the “Go back” option that reverts to the previous Windows version. Wait until the new build has been stable for a week or two, then remove it through Disk Cleanup.

Does deleting temporary files speed up the PC?

Indirectly. Temp files do not slow down the processor, but a system drive above roughly 90% full does slow down writes and updates, so freeing space on a nearly full C: produces a real improvement.

Know what is included before you buy.

The one-time 30-minute trial covers core tools. PRO-labelled features stay locked until a paid license is activated.

Read next

All articles · FAQ

Write to us: [email protected]