Delete Temp Files in Windows 11 and 10 Safely

Logeshwaran

Windows temp files live in two places: your own at C:\Users\you\AppData\Local\Temp (press Win + R, type %temp%, Enter, and you are there) and the system’s at C:\Windows\Temp. Both are safe to empty, and the fastest way is the one built in: Settings → System → Storage → Temporary files, check the boxes, click Remove files. That is the whole answer for most people, and it reclaims anywhere from a few hundred megabytes to, after a feature update, thirty gigabytes or more. But two things on that Settings page are not what they look like, and both cost people real data every week: "Downloads" is listed as a temporary-files category and is not temporary at all — check it and every file you have ever downloaded is gone — and "Previous Windows installation(s)" is the only copy of the Windows you had before the last big update; delete it and the ten-day option to go back disappears with it. This guide covers what temp files actually are and why Windows makes so many, every place they hide, how to clear them on Windows 11 and 10 by Settings, Disk Cleanup, command line, and Storage Sense on a schedule, why some "won’t delete," how to move the Temp folder off a full C: drive, and what IT departments do about a thousand machines full of them.

⚡ Quick Answer

Where: %temp% (yours) and C:\Windows\Temp (system). Win + R → type either → Enter.

Clear them safely: Settings → System → Storage → Temporary files → check Temporary files, Windows Update Cleanup, Delivery Optimization Files, Thumbnails → Remove files. Uncheck Downloads. Leave Previous Windows installation(s) unless you are sure.

Automatically: Settings → Storage → Storage Sense → On, and set how often. Never touches Downloads unless you tell it to.

What temp files are, the full list of folders, cmd and PowerShell one-liners, "file in use," moving Temp to another drive, and the IT-admin view — below.

What are temp files in Windows, and why are there so many?

My friend Ethan, who has cleaned more full C: drives than he cares to count, describes temp files as the scratch paper on a desk. A program working on something — installing itself, unzipping a download, rendering a document for printing, holding a half-saved file while you type — needs somewhere to put the pieces. Windows gives every program the same answer: put it in Temp, and clean up after yourself. The first half of that instruction is universally obeyed. The second half is not. Installers crash and leave their unpacked files behind; browsers keep caches "in case"; Windows Update stages gigabytes of components and then keeps the old ones for a rollback that never comes; a program is killed mid-task and its scratch paper stays on the desk forever. Multiply by years and every application you have ever run, and the desk is buried.

Two things follow from that picture. First, temp files are safe to delete by definition — a program that stores anything it needs later in Temp is broken, and Windows itself deletes the folder’s contents at will. The only files you cannot delete are the ones a running program is using right now, and Windows simply refuses those, so there is nothing to be careful about. Second, the name "temporary files" in Windows 11’s Settings has been stretched to cover a broader family — update leftovers, thumbnails, the Recycle Bin, crash dumps, the previous Windows installation, and (unwisely) the Downloads folder — and not all of those are scratch paper. The sections below keep the two ideas separate: the true temp folders, which you can empty blindly, and the Settings categories, which deserve a glance before you click.

Where are temp files stored in Windows 11 and 10? Every location

LocationShortcutWhat is in itSafe to empty?
C:\Users\you\AppData\Local\Temp%temp% or %tmp%Your programs’ scratch files: installer leftovers, Office autosave fragments, browser downloads in progress, app crash logsYes — files in use are skipped automatically
C:\Windows\Temp%windir%\TempSystem-level scratch: services, installers run as SYSTEM, update staging, driver installsYes (needs administrator)
C:\Windows\SoftwareDistribution\DownloadDownloaded Windows Update packages awaiting or after installYes, after stopping the Windows Update service; Settings’ Windows Update Cleanup handles the installed leftovers
C:\Windows\PrefetchSmall files that speed up app launchesHarmless but pointless: tiny, and Windows rebuilds them, so apps launch slower for a while. Leave it.
C:\Users\you\AppData\Local\Microsoft\Windows\INetCache and browser cache foldersWeb caches: Edge/Chrome under AppData\Local\...\User Data\Default\CacheYes, but clear from inside the browser so it stays consistent
C:\Users\you\AppData\Local\Microsoft\Windows\ExplorerThumbnail and icon caches (thumbcache_*.db)Yes; Settings’ Thumbnails category does it properly
C:\$Recycle.BinRecycle BinDeleted files awaiting permanent deletionYes, once you are sure
C:\Windows.oldThe previous Windows version after a feature update; 10–30 GBOnly if you will not go back. Windows deletes it itself after 10 days.
C:\Windows\Logs\CBS, C:\Windows\Minidump, C:\Windows\LiveKernelReportsServicing logs and crash dumps; occasionally balloon to gigabytesYes; Settings’ System error memory dump files covers dumps
C:\ProgramData\Microsoft\Windows\WERWindows Error Reporting queueYes

And the one that is not temporary, however Windows labels it: C:\Users\you\Downloads. It appears in the Settings list because Microsoft’s data showed it is where the largest forgotten files live. It contains every file you have saved from a browser, and nothing about it is scratch paper.

Delete temp files in Windows 11 through Settings, step by step (and what each box means)

  1. Open Settings → System → Storage. Wait a few seconds while Windows scans the drive; the bars fill in.
  2. Click Temporary files. (If you do not see it, click Show more categories.) Windows lists each category with its size.
  3. Read the list before checking anything. The categories, and Ethan’s verdict on each, are in the table below.
  4. Check the ones you want — a good default is Temporary files, Windows Update Cleanup, Delivery Optimization Files, Thumbnails, Temporary Internet Files, DirectX Shader Cache, and Microsoft Defender Antivirus — and uncheck Downloads, which Windows sometimes pre-checks.
  5. Click Remove files and confirm. Large categories (Windows Update Cleanup, Previous Windows installation) can take several minutes and may finish after a restart; the space appears when they do.
  6. Back on the Storage page, click Cleanup recommendations for a second pass that finds large or unused files, files already synced to the cloud, and unused apps — a separate, more manual list.
Category in SettingsWhat it really isCheck it?
Temporary filesThe %temp% and Windows\Temp foldersYes
Windows Update CleanupSuperseded update components kept for uninstalling old updates; often the biggest itemYes — you lose the ability to uninstall updates older than the current ones, which almost nobody needs
Delivery Optimization FilesUpdate chunks cached to share with other PCsYes
ThumbnailsCached picture previewsYes; Explorer rebuilds them as you browse folders (slightly slower at first)
Temporary Internet FilesEdge/IE legacy cacheYes
DirectX Shader CacheCompiled shaders for gamesYes, but games stutter briefly on next launch while rebuilding; gamers may leave it
Microsoft Defender AntivirusOld scan logs and definition leftoversYes
System error memory dump files / minidumpCrash dumps from blue screensYes, unless you are mid-way through diagnosing crashes
Recycle BinYour deleted filesOnly after a glance inside
Previous Windows installation(s)Windows.old — the rollback copyOnly if the update has been fine for a week or more. Deleting it ends the 10-day "Go back" option.
Windows upgrade log files / Windows ESD installation filesSetup logs; compressed install media kept for Reset this PCLogs yes; ESD files no unless desperate — without them, Reset this PC needs a download
DownloadsYour Downloads folder. Not temporary.No. Sort it yourself.

Delete temp files in Windows 10: Settings and Disk Cleanup

Windows 10 has the same Storage page — Settings → System → Storage → Temporary files — with the same categories and the same Downloads trap, and the steps above apply unchanged. It also still has the classic Disk Cleanup tool, which Windows 11 keeps too but hides. Search Start for disk cleanup (or run cleanmgr), pick drive C:, and you get the simple list; click Clean up system files, pick C: again, and the list grows to include Windows Update Cleanup, Previous Windows installation(s), and device driver packages. Disk Cleanup’s advantage is transparency: each item has a description panel, and it does not list Downloads at all, so there is nothing to accidentally check. Its disadvantage is that Microsoft has stopped improving it; Storage Sense and the Settings page are the maintained path, and a few newer categories (Delivery Optimization, shader cache) only appear there. Use whichever you like; they clean the same folders.

Clear the Temp folder by hand: the %temp% method

  1. Close the programs you are not using; open programs hold files in Temp, which is fine, but fewer open means a cleaner sweep.
  2. Press Win + R, type %temp%, press Enter. File Explorer opens your Temp folder.
  3. Press Ctrl + A to select everything, then Shift + Delete to delete permanently (skipping the Recycle Bin, which would just move the junk somewhere else on the same drive). Confirm.
  4. When Windows says a file is in use, choose Skip and check Do this for all current items. Those files belong to running programs and are supposed to stay.
  5. Repeat for the system folder: Win + R → C:\Windows\Temp → Enter. You will be asked for administrator permission; approve it. Same Ctrl + A, Shift + Delete, Skip.

This is exactly what the Settings page’s Temporary files checkbox does, minus the other categories, and it is useful when you want to see what is in there — a Temp folder with a hundred folders named like {3F2A9C1E-…} is a stack of dead installer sessions, and a single file of several gigabytes is usually a crashed download or a video editor’s render cache and tells you which program to look at.

Delete temp files from cmd or PowerShell: the one-liners

For people who would rather type, or who want a shortcut on the desktop. Open Terminal (Admin) (right-click Start). The Command Prompt form, which clears your Temp and the system Temp and silently skips files in use:

del /q /f /s "%temp%\*" 2>nul
for /d %d in ("%temp%\*") do rd /s /q "%d" 2>nul
del /q /f /s "%windir%\Temp\*" 2>nul
for /d %d in ("%windir%\Temp\*") do rd /s /q "%d" 2>nul

(In a batch file, write %%d instead of %d.) The PowerShell form, which is one line per folder and reports nothing about files it could not remove:

Remove-Item -Path "$env:TEMP\*" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path "$env:windir\Temp\*" -Recurse -Force -ErrorAction SilentlyContinue

And for the built-in tool from the command line, which can be pre-configured once and then run silently forever: cleanmgr /sageset:1 opens a checklist (check what you want, including Windows Update Cleanup; it saves the choice under profile 1), and cleanmgr /sagerun:1 runs that profile without asking. Put the second command in Task Scheduler and you have a scheduled cleanup that predates Storage Sense and still works. One thing none of these commands should include: the Windows Update download folder while the update service is running. If you need that (a stuck update), stop the service first — net stop wuauserv, delete C:\Windows\SoftwareDistribution\Download\*, net start wuauserv — and see our stuck Windows Update guide, which walks that sequence properly.

Storage Sense: clearing temp files automatically, and the settings that matter

Storage Sense is the "never think about this again" option, and it is worth turning on with three settings read carefully. Settings → System → Storage → Storage Sense. The first toggle, Cleanup of temporary files, keeps Windows and app temp files under control continuously and is the one to enable. Below it, Automatic User content cleanup turns on the scheduled sweep with three choices: Run Storage Sense (every day / week / month / only when low on disk space — during low free disk space is the sensible default), Delete files in my recycle bin if they have been there for over (30 days is a good balance between recoverability and space), and Delete files in my Downloads folder if they haven’t been opened for more than — which defaults to Never and should stay there unless you genuinely treat Downloads as disposable. A fourth option appears if you use OneDrive: Locally available cloud content can be turned back into online-only placeholders after a set period, which is a real space saver on a small SSD and a real surprise if you expected the files to be there on a plane. Windows 10’s Storage Sense has the same options under Settings → System → Storage → Configure Storage Sense or run it now. Either version has a Run Storage Sense now button at the bottom for an immediate pass.

Jake’s full C: drive: the 31 GB he found and the 4 GB he almost lost

Jake’s laptop has a 256 GB drive, which in 2026 is a small drive, and a red bar under C: in File Explorer. Windows Update had refused to install for lack of space. He opened Settings → Storage → Temporary files and the list added up to 38 GB: 22 GB of Previous Windows installation(s) from the 25H2 upgrade six weeks earlier, 7 GB of Windows Update Cleanup, 2 GB of Temporary files, and — near the bottom, pre-checked — 4.1 GB of Downloads. He had his finger on Remove files when he noticed the last line, opened his Downloads folder in a second window, and found the only copy of a client’s signed contract and the installer for the accounting software he had paid $300 for. He unchecked Downloads, cleared the rest, and got 31 GB back. Windows Update installed that evening.

What Ethan added, when Jake told the story: the previous installation was safe to delete because six weeks had passed — the 10-day rollback window had long expired and Windows would have deleted it itself soon anyway, which is why it was still there only because a scheduled cleanup had been skipped. Had the upgrade been four days old, the right move would have been to clear everything else first and give the new version a week. And the Downloads line: Jake now keeps Storage Sense’s Downloads option on Never, and moves anything that matters out of Downloads the day it arrives, because a folder Windows is willing to list under "temporary" is not a filing cabinet.

Temp files won’t delete, or come straight back: every cause

SymptomCauseFix
"The action can’t be completed because the file is open in…"A running program owns the file; Windows protects itSkip it. Or close the named program, or restart and delete before opening anything
Settings shows the same size after Remove filesCleanup runs in the background; Windows Update Cleanup finishes on restartRestart, then re-open Storage; the number updates
Windows Update Cleanup never shrinksComponent store needs the servicing command, not the folderAdmin prompt: Dism /Online /Cleanup-Image /StartComponentCleanup (add /ResetBase to also remove the ability to uninstall existing updates)
Temp fills again within daysOne program is leaking — a failing installer retrying, a crashing app writing dumps, a sync clientOpen %temp%, sort by size and date, read the newest folder names; fix or uninstall the culprit
Previous Windows installation won’t deletePermissions on Windows.oldUse Disk Cleanup → Clean up system files, which has the rights; never delete the folder by hand
Access denied in C:\Windows\TempNot an administrator, or files owned by SYSTEMRun the command line as administrator; skip what remains
Space does not come back after deletingFiles went to the Recycle Bin, or Volume Shadow Copies / System Restore are holding old blocksEmpty the Recycle Bin; Disk Cleanup → More Options → System Restore and Shadow Copies → Clean up

Moving the Temp folder to another drive (and whether you should)

On a PC with a small C: SSD and a big D: drive, people ask whether Temp can live on D:. It can: the location is just two environment variables. Search Start for Edit environment variables for your account, and in the top list change both TEMP and TMP from %USERPROFILE%\AppData\Local\Temp to, say, D:\Temp (create the folder first). Sign out and in. The system pair in the lower list moves C:\Windows\Temp the same way; leave those unless C: is truly desperate, because some installers and Windows Update itself expect the system Temp on the Windows drive. Two honest caveats. If D: is a slower hard disk, everything that uses Temp — installers, unzipping, Office autosave — slows down to match, which on a machine with an SSD C: is a bad trade for a few gigabytes. And if D: is a removable or network drive that is ever absent, programs that need Temp will fail in strange ways. Ethan’s rule: move Temp only to an internal SSD, and consider first whether Storage Sense and a cleared Windows.old solve the problem without moving anything.

Do you need CCleaner or a "PC cleaner" app? An honest answer

No. Everything a cleaner app does to temp files, the Settings page and Storage Sense do natively, for free, without a background service, and without the "registry cleaning" and "PC health score" features that exist to sell an upgrade. The one thing a third-party tool adds is cleaning application caches Windows does not know about — a video editor’s render cache, a game launcher’s shader store, Photoshop’s scratch disk — and for those, the application’s own preferences page is the right place, because it knows what it can safely drop. If you want to see where the space is going, the free open-source tool WizTree (or WinDirStat) maps the drive as a treemap in seconds and is genuinely useful; it deletes nothing on its own. The "your PC has 3,412 issues" genre of software is where our registry-reset guide came from, and that page explains at length why the number is invented.

For IT admins: temp files at fleet scale

The help-desk pattern is always the same: a feature update fails for lack of space on 128 GB and 256 GB devices, and the culprits are Windows.old, the component store, and user Temp folders that have never been emptied. The maintained answer is Storage Sense by policy: Computer Configuration → Administrative Templates → System → Storage Sense (Allow Storage Sense, Configure Storage Sense cadence, Configure Storage Sense Recycle Bin cleanup threshold, Configure Storage Sense Downloads cleanup threshold — set that last one to 0 to leave Downloads alone, and tell users you have), with the same settings in Intune’s settings catalog under Storage. For a one-off reclaim before a feature update, a remediation script running cleanmgr /sagerun with a pre-seeded StateFlags profile under HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches is deterministic and quiet; Dism /Online /Cleanup-Image /StartComponentCleanup /ResetBase reclaims the component store but forfeits update uninstall, so run it after a stable cumulative, not during a rollout. Do not delete Windows.old by script inside the rollback window on devices whose upgrade you have not validated; the folder is your undo. And two things worth monitoring rather than cleaning: a Temp folder that refills at gigabytes per day is an application leaking (Endpoint analytics or a simple size query via your RMM finds it), and C:\Windows\Temp growing with thousands of MSI*.log files means an installer is looping — both are tickets to solve upstream, not disk to reclaim monthly.

FAQ — Windows temp files, answered straight

What are temp files in Windows?

Scratch files programs and Windows create while working — installer pieces, caches, autosaves, update staging — that are supposed to be deleted afterward and often are not. Safe to remove.

Where are temp files located in Windows 11 and 10?

Yours: C:\Users\you\AppData\Local\Temp (Win + R → %temp%). System: C:\Windows\Temp. Plus update caches, thumbnails, and Windows.old, which the Settings page groups together.

Is it safe to delete temp files in Windows?

Yes. Files in use are skipped automatically. The only items on the Settings list to think about are Downloads (not temporary) and Previous Windows installation (your rollback).

How do I delete temp files in Windows 11?

Settings → System → Storage → Temporary files → check the categories → Remove files. Uncheck Downloads. Or Win + R → %temp% → Ctrl + A → Shift + Delete.

How do I delete temp files in Windows 10?

Same Settings → System → Storage → Temporary files path, or Disk Cleanup (cleanmgr) → Clean up system files.

How do I open the temp folder?

Win + R, type %temp%, Enter. For the system folder, type C:\Windows\Temp.

Why won’t some temp files delete?

A running program is using them. Skip those; they are supposed to stay until the program closes. Restart and try again if you want a complete sweep.

How do I delete temp files with cmd?

Admin prompt: del /q /f /s "%temp%\*" and for /d %d in ("%temp%\*") do rd /s /q "%d"; repeat with %windir%\Temp. Or cleanmgr /sagerun:1 after a one-time /sageset:1.

How do I delete temp files with PowerShell?

Remove-Item "$env:TEMP\*" -Recurse -Force -ErrorAction SilentlyContinue, and the same with $env:windir\Temp.

How do I delete temp files automatically?

Settings → System → Storage → Storage Sense → On; set the schedule, Recycle Bin age, and leave Downloads on Never.

Is Windows Update Cleanup safe to delete?

Yes. You lose only the ability to uninstall updates older than the current set. It is usually the largest category.

Should I delete "Previous Windows installation(s)"?

Only once the new version has been fine for a week or more. It is the Windows.old rollback copy; Windows removes it itself after 10 days.

Why is Downloads listed under temporary files?

Because it is where large forgotten files live. It is not temporary; uncheck it, and keep Storage Sense’s Downloads setting on Never.

What is the difference between %temp% and C:\Windows\Temp?

%temp% is per user, for your programs; C:\Windows\Temp is system-wide, for services and installers running as SYSTEM. Both are safe to empty; the second needs administrator rights.

Can I delete the Prefetch folder?

You can, but it is tiny and makes apps launch slower until it rebuilds. Leave it.

Why do temp files keep coming back?

Normal use creates them constantly. If gigabytes return within days, one program is leaking — sort %temp% by date and size to find it.

Can I move the temp folder to another drive?

Yes, by changing the TEMP and TMP environment variables for your account to a folder on the other drive. Only worth it if the other drive is an internal SSD.

Does deleting temp files speed up the PC?

Only indirectly, by freeing space on a nearly full SSD, which does slow down. It does not make Windows faster otherwise.

Do I need CCleaner to delete temp files?

No. Settings, Disk Cleanup, and Storage Sense do it natively. Use apps’ own cache settings for app-specific caches.

Where is Disk Cleanup in Windows 11?

Still there: search Start for Disk Cleanup or run cleanmgr. Click Clean up system files for the full list.

Revision note. Written August 29, 2026, for Windows 11 and 10 into the full picture: what the files are, every folder, the Settings categories with the two that are not what they seem, the command-line and Storage Sense routes, and the fleet view — Settings paths checked against Microsoft’s current support documentation the same day. If Microsoft renames a category (they have twice), tell us through the contact page and we will put it right. And if your C: drive is red right now: the Settings page will get you back tens of gigabytes in five minutes. Just read the list before you click, uncheck Downloads, and give a fresh feature update its week. Jake got 31 GB back and kept the contract. You can have both too.

Related