To delete temporary files in Windows 11, open Settings > System > Storage > Temporary files, tick the types of files you want to remove, and select Remove files. Before you click, untick Downloads (it deletes your whole Downloads folder) and check the Recycle Bin for anything you still want. For files Settings leaves behind, empty the %temp% folder by hand, and turn on Storage Sense so Windows clears temporary files on its own.
Applies to: Windows 11, including version 26H2. The Settings route matches Microsoft’s page on how to free up drive space in Windows. Using Windows 10? Follow the Windows 10 steps for deleting temp files instead, since a few menus differ.
Before you start
Temporary files are working files that Windows and apps create while they install software, load web pages and download updates. They’re supposed to be removed afterward, but many stay behind and can grow to several gigabytes. Windows and your apps recreate anything they still need, so clearing them won’t break anything.
Three quick checks save trouble later:
- Look in Downloads and the Recycle Bin. Both appear in the Temporary files list, but they hold your own files, not system leftovers. Once Windows removes them, don’t count on getting them back.
- Close your apps. Files that an open app is using can’t be deleted, so closing apps (or restarting first) lets more get cleared.
- Use an administrator account if you can. Your own temp folder needs no special rights, but system items such as Windows Update leftovers and the C:\Windows\Temp folder ask for administrator approval.
Windows keeps temporary files in two main folders. Your personal one is C:\Users\your name\AppData\Local\Temp (for a user named Alex, that’s C:\Users\Alex\AppData\Local\Temp), which you can open by typing %temp%. The system-wide one is C:\Windows\Temp.
Delete temporary files in Settings
This is the safest method, because Windows only lists files it can remove and shows how much space each type uses.
- Press Windows + I to open Settings.
- Select System in the left pane, then Storage on the right. You’ll see a bar for your C: drive and categories such as Installed apps and Temporary files.
- Select Temporary files. Windows scans the drive for a few seconds, then lists each type of file with its size.

- Tick the items you want to delete and untick the rest. The total you’ll free appears above the list (the table below explains the usual items).
- Select Remove files, then Continue if Windows asks you to confirm.
- Wait for the list to refresh. The sizes of the items you removed drop to zero or close to it.
| Item | What it is | Tick it? |
|---|---|---|
| Windows Update Cleanup | Older copies of updated system files | Yes, if Windows is working normally. It’s often the biggest item after an update. |
| Delivery Optimization Files | Update files Windows can share with other PCs | Yes |
| Temporary files, Temporary Internet Files | App leftovers and cached web content | Yes |
| Thumbnails, DirectX Shader Cache | Image previews and graphics caches | Yes. Windows rebuilds them, so folders and games may load a little slower the first time. |
| Windows error reports and log files | Crash reports and setup logs | Yes, unless you’re troubleshooting a problem |
| Recycle Bin | Files you deleted | Only after checking it |
| Downloads | Everything in your Downloads folder | Usually no |
| Previous Windows installation(s) | Your old Windows version after an upgrade | Only if you’re sure you won’t roll back |
The list changes from PC to PC, so you may see extras such as Device driver packages or Microsoft Defender Antivirus. If an item isn’t explained here, leave it unticked. Previous Windows installation(s) deserves a warning: Microsoft says that removing it deletes the Windows.old folder and you can’t go back to your earlier version, and this can’t be undone.
To clean a second drive, go to Settings > System > Storage, expand Advanced storage settings, select Storage used on other drives, pick the drive, then open its Temporary files.
A quicker route: Cleanup recommendations
On the same Storage page, Cleanup recommendations groups the biggest wins in one place. Open it, expand Temporary files, tick what you want gone and select Clean up. The same screen also suggests large or unused files, files already synced to the cloud and apps you rarely use. It shows fewer temporary categories than the full Temporary files page, so use the full page when you want a thorough clean.
Which other method should you use?
- Settings didn’t free enough space: empty the Temp folders by hand.
- You clean up often: use the one-line command, or let Storage Sense do it automatically.
- You prefer the classic tool, or Settings won’t finish scanning: use Disk Cleanup.
Empty the Temp folders by hand
Settings doesn’t always clear everything in your personal Temp folder. Microsoft’s own advice for doing it manually is to stick to the Temp folders, because deleting the wrong files elsewhere can cause problems.
- Close as many apps as you can.
- Press Windows + R to open the Run box, type %temp% and press Enter. File Explorer opens your personal Temp folder, which is usually full of files and folders with random names.
- Press Ctrl + A to select everything, then press Delete.
- If a File In Use or Folder In Use message appears, tick Do this for all current items and select Skip. Those files belong to programs that are running and will be cleared another time.

- Open the Run box again, type C:\Windows\Temp and press Enter. If Windows says you don’t have permission to access the folder, select Continue (this needs an administrator account). Select everything, delete it, and skip anything in use.
- Empty the Recycle Bin. Files deleted with the Delete key go there first and keep using space until it’s emptied. If you’d rather skip the bin, press Shift + Delete in step 3, which deletes permanently.
Don’t delete other folders inside C:\Windows or AppData. Only the folders named Temp are meant to be emptied.
Clear your Temp folder with a command
A command is quicker if you do this regularly. Right-click the Start button, select Terminal, open a Command Prompt tab from the drop-down arrow, and run:
del /q /f /s %TEMP%\*
Here’s what the switches do, based on Microsoft’s reference for the del command: /q skips the confirmation prompt, /f includes read-only files and /s includes every subfolder. Files deleted with del can’t be retrieved, so type the command exactly as shown. Files that are in use are skipped with an error message for each one, which is normal. Empty subfolders stay behind, but they take up almost no space.
You can paste the command into Notepad, save it as cleantemp.bat (set Save as type to All files) and double-click the file whenever you want a quick clean.
Use Disk Cleanup
The older Disk Cleanup tool is still part of Windows 11 and removes the same kinds of files as the Settings page.
- Select Start, type Disk Cleanup and open it. (You can also type cleanmgr in the Run box.)
- Choose drive C: and select OK. Disk Cleanup calculates how much it can free.
- Select Clean up system files and choose C: again. This rescans with administrator rights and adds items such as Windows Update Cleanup.
- Tick the items you want removed. Select an item to see a description of it underneath the list.

- Select OK, then Delete Files.
Disk Cleanup can also save a set of choices and reuse them. Running cleanmgr /sageset:1 lets you pick the items once, and cleanmgr /sagerun:1 cleans them again without questions, as described in Microsoft’s cleanmgr command reference.
Clear temporary files automatically with Storage Sense
- Go to Settings > System > Storage.
- Under Storage management, turn Storage Sense on, then select the Storage Sense name to open its settings.
- Make sure Keep Windows running smoothly by automatically cleaning up temporary system and app files is ticked.
- Under Run Storage Sense, choose how often it runs: Every day, Every week, Every month or During low free disk space.
- Set how long files can stay in the Recycle Bin and in Downloads before they’re deleted. Never is the safe choice for Downloads.

- Select Run Storage Sense now if you want it to clean up straight away.
Microsoft’s Storage Sense page notes that it can also make unused OneDrive files online-only, which frees space without deleting them from the cloud. Each option is covered in detail in how to use Storage Sense in Windows 11.
Browser and app caches
Browsers keep their own temporary files. In Microsoft Edge or Google Chrome, press Ctrl + Shift + Delete, choose a time range, tick Cached images and files, and clear it. Leave cookies and passwords unticked if you want to stay signed in to websites. For the Microsoft Store and DNS caches as well, see clearing the cache in Windows 11.
What to leave alone
- The Prefetch folder (C:\Windows\Prefetch). Some guides suggest emptying it, but Windows uses it to start apps faster, it rebuilds itself, and it isn’t one of the Temp folders. Clearing it gains little and can make apps open slowly for a while.
- Anything else in C:\Windows, Program Files or AppData. Only the Temp folders are safe to empty by hand.
- Windows ESD installation files, if that item appears. Windows can use these files when you reset the PC, so keep them unless you’re very short on space.
- Downloads you haven’t checked. Sort through them yourself, or follow deleting downloads in Windows 11 to clear the folder deliberately.
Registry cleaners won’t free useful space, and cleaning the registry in Windows 11 safely explains why they aren’t needed.
If temporary files won’t delete
Some files are “in use” every time
Restart the PC and clear the Temp folders before you open any apps. Background programs such as cloud sync apps, antivirus tools and updaters can still hold a few files. If a stubborn file keeps blocking you, starting Windows with a minimal set of drivers and apps releases most locks; getting into Safe Mode in Windows 11 shows how. A handful of locked files is harmless, though, so you don’t need to chase every one.
“You’ll need to provide administrator permission”
This appears for C:\Windows\Temp and for system items in Settings or Disk Cleanup. Select Continue on an administrator account, or ask the person who manages the PC. On a work or school PC, your organization may block these folders.
The Temporary files page keeps scanning
Give it a few minutes on a large or slow drive. If it never finishes, restart the PC and use Disk Cleanup instead.
The free space didn’t go up
Empty the Recycle Bin, because files deleted from File Explorer stay there until you do. The steps to empty the Recycle Bin in Windows 11 cover every way to do it. Windows also sets aside some reserved storage for updates, caches and temporary files, and it manages that space itself, so it won’t show up as space you can free.
Microsoft Store apps or updates show temp folder errors
Microsoft suggests running the Windows Store Apps and Windows Update troubleshooters from Settings > System > Troubleshoot > Other troubleshooters, and clearing the Store cache by typing wsreset.exe in the Run box.
Check that it worked
Go back to Settings > System > Storage and compare the free space on the C: drive bar with what it showed before. Temporary files should now be one of the smaller categories. Open %temp% again: only a few files that were in use, plus some empty folders, should remain. Temporary files start building up again as soon as you use the PC, which is expected.
There’s no undo for removed temporary files, and you won’t need one for the system items. If you removed Downloads or emptied the Recycle Bin by mistake, your best chance is a backup such as File History or OneDrive’s own recycle bin for synced files.
Frequently asked questions
Is it safe to delete everything in the Temp folder?
Yes. Anything an app still needs is either in use (and skipped) or recreated the next time the app runs. The real risk is in other folders, so stay inside the folders named Temp.
Why does my Temp folder fill up again so fast?
Installers, updates, browsers and Office apps write new temporary files every day. Storage Sense keeps the folder in check without you having to remember.
How often should I clear temporary files?
Once every month or two is plenty for most people, or after a big Windows update when Windows Update Cleanup tends to be large. With Storage Sense turned on, you rarely need to do it by hand.
Will deleting temp files make Windows 11 faster?
Only if your drive was nearly full. Windows needs free space for updates and virtual memory, so clearing a full drive can help, but on a PC with plenty of free space you probably won’t notice a speed difference.
Can I delete .tmp files I find in other folders?
Be careful. Some apps, Office apps among them, can keep temporary files next to a document while it’s open and remove them when you close it. Close the app first; a .tmp file still there afterward is usually a leftover, but check its date and name before deleting it.
Need more space?
If the drive is still tight after clearing temporary files, finding large files in Windows 11 shows what’s actually using the space. For a full checklist covering apps, startup items and old updates, work through a complete Windows 11 cleanup with built-in tools, or try the methods for freeing up disk space in Windows 11.

Matt Jacobs writes and maintains the guides on Support Your Tech, which he started in 2017. He spent most of his career keeping small-business PCs running and still takes the occasional consulting job, so the steps here come from fixing the same problems on other people’s computers. Every guide is checked on his own Windows 11, Windows 10, Mac, iPhone and iPad before it goes up.