How to Delete Temporary Files on Windows (Temp, .tmp, and Junk Files)
If your PC feels slower than usual or you’re running low on disk space, deleting temporary files is one of the quickest maintenance tasks you can perform. Whether you want to delete temporary files in Windows, clear temp files, remove temporary files, or perform a complete temp files cleanup, Windows includes several built-in tools that make the process simple.
This guide explains every reliable method to delete temporary files, including the Win + R %temp% command, Disk Cleanup, Storage Sense, Windows Temp folder, and Command Prompt. You’ll also learn the difference between %temp% and temp, where the temporary files folder is located, and which files are safe to remove.
Can You Delete Temporary Files?
Yes. Temporary files (often with .tmp or .temp extensions) are safe to delete in almost all cases. Windows and your installed programs create them automatically to store data temporarily while a task is running — things like unfinished downloads, cache data, or backup copies made during an update. Once the related program or process finishes, these files are no longer needed. Deleting them won’t affect your installed programs, personal files, or Windows itself.
The only time you should be cautious is if a program is actively running — in that case, close the program first before clearing its temp files.
Method 1: Delete Temporary Files Using the %temp% Run Command
This is the fastest way to open your temporary files folder and clear it out.
- Press Win + R to open the Run dialog box
- Type %temp% and press Enter
- This opens the Temp folder located inside your AppData directory
- Press Ctrl + A to select all files
- Press Delete, or right-click and choose Delete

Some files may show a “file in use” message — this is normal. Just click Skip and continue; Windows will delete everything else.
This method is one of the quickest ways to delete temp files and clear temp files without installing any additional software.

Tip: You can also delete the system-wide temp folder the same way:
- Press Win + R
- Type temp and press Enter
- Select all files and delete them
Both folders store different sets of temp files, so it’s worth clearing each one.
Method 2: Delete Temporary Files Using Disk Cleanup
Disk Cleanup is a built-in Windows tool designed specifically to clear junk files, including temp files, in one pass.
- Click the Start menu and search for Disk Cleanup
- Select the drive you want to clean (usually C:) and click OK
- Wait for the scan to finish
- Check the box next to Temporary files (also look for Temporary Internet Files, Recycle Bin, and Thumbnails if you want to clear more junk at once)
- Click OK, then confirm by clicking Delete Files

Disk Cleanup usually lists several other categories worth checking off at the same time:

- Windows upgrade log files
- System created Windows Error Reporting files
- Windows Defender Antivirus files
- Windows Update Cleanup
- Thumbnails
- Temporary files
- Recycle Bin
- Temporary Internet Files
- Delivery Optimization Files
- DirectX Shader Cache
- Previous Windows installation(s)
Selecting all of these at once clears out far more junk than temp files alone — some categories, like a previous Windows installation, can free up several gigabytes on their own.
For a deeper clean, click Clean up system files at the bottom of the Disk Cleanup window — this scans additional system-level temp and junk files, including old Windows Update leftovers.
Method 3: Clear Temp Files From Windows Settings (Storage Sense)
Windows 10 and 11 both include a built-in cleanup tool inside Settings that can automatically remove temporary files.

- Open Settings
- Go to System → Storage
- Click Temporary files under the storage breakdown
- Windows will scan and list temporary file categories
- Check the boxes for the file types you want to remove (Temporary files, Recycle Bin, Downloads folder, etc.)
- Click Remove files


You can also turn on Storage Sense from this same screen so Windows automatically deletes temporary files on a schedule going forward.
Method 4: Manually Delete Temporary Files From the AppData Folder
Many temporary files created by installed applications live inside your AppData folder rather than the main system temp folder.
- Press Win + R
- Type %localappdata%\Temp and press Enter
- Select all the files inside (Ctrl + A)
- Delete them
This folder tends to accumulate .tmp and .temp files from software installers, updates, and background processes that don’t always clean up after themselves.
Method 5: Delete Temporary Files Using Command Prompt
If you prefer using a command instead of navigating folders manually, Command Prompt can clear temp files in seconds.
- Search for Command Prompt in the Start menu, right-click it, and choose Run as administrator
- Run the following commands one at a time:
del /q/f/s %TEMP%\*
del /q/f/s C:\Windows\Temp\*
The /q flag runs the deletion quietly, /f forces deletion of read-only files, and /s clears subfolders too. This command-based method is useful if you’re clearing temp files as part of a routine cleanup script.
What Are .tmp and .temp Files?
.tmp and .temp files are placeholder files created by Windows and installed programs while a task is in progress — for example, while a document autosaves, an installer runs, or a file downloads. They’re typically deleted automatically once the task completes, but interrupted processes (a crash, a forced shutdown, or a failed install) can leave them behind. Because these files serve no ongoing purpose once orphaned, they’re generally safe to delete using any of the methods above.
Clearing Cache and Other Junk Files
Temporary files are just one category of junk files that build up over time. For a fuller cleanup, also consider clearing:
- Browser cache — in Chrome, Edge, or Firefox, go to browser settings → Privacy → Clear browsing data, and select “Cached images and files”
- Recycle Bin — right-click the Recycle Bin icon and select Empty Recycle Bin
- Windows Update leftovers — accessible through Disk Cleanup’s “Clean up system files” option
- Thumbnail cache — also available as a checkbox inside Disk Cleanup
Running Disk Cleanup or Storage Sense periodically handles most of this in one step, so you don’t need to clear each one manually every time.
Using a Third-Party Cleaner (CCleaner and Similar Tools)
If you’d rather not go through Windows tools manually, third-party cleanup software can automate the process across your system and browsers in one pass.
- Download and open CCleaner (or a similar reputable cleaner)
- Go to Options → Advanced
- Check “Only delete files in the Windows Temp folder older than 24 hours” — this avoids deleting files still in active use
- Run the cleanup from the main screen

These tools typically also clear browser cache, cookies, and download history for Chrome, Firefox, and Edge at the same time, which is useful if you’re cleaning up multiple areas at once rather than doing it browser by browser.
Note on compatibility: All the manual methods above (Run command, Disk Cleanup, Command Prompt) work the same way across Windows 7, 8, 10, and 11. The Settings → Storage method is only available on Windows 10 and 11, since Windows 7 and 8 don’t include Storage Sense.
Frequently Asked Questions
How do I delete temporary files from my PC? The quickest method is pressing Win + R, typing %temp%, and deleting everything inside the folder that opens. For a more thorough clean, use Disk Cleanup or the Storage settings in Windows.
How do I delete temporary files on Windows 11 specifically? The steps are the same as Windows 10: Settings → System → Storage → Temporary files, or use the %temp% Run command. Windows 11 also includes Storage Sense for automatic scheduled cleanup.
Is there a command to delete temp files? Yes — running del /q/f/s %TEMP%\* in an administrator Command Prompt window deletes all files in your temp folder.
Where is the temporary files folder located? Temporary files are stored in two main locations: %temp% (which points to C:\Users\[username]\AppData\Local\Temp) and C:\Windows\Temp for system-level temp files.
Will deleting temp files delete my personal files? No. Temp files are separate from your documents, photos, and other personal files. Deleting them only removes leftover system and application data, not anything you’ve created or saved yourself.
Why won’t some temp files delete? If a file shows “in use” or won’t delete, it usually means a program is actively using it. Close any open applications and try again, or restart your PC and delete the files before opening other programs.
Final Thoughts
Deleting temporary files is one of the simplest maintenance tasks you can do to keep Windows running smoothly and free up disk space. Whether you use the quick %temp% Run command, Disk Cleanup, or Windows Settings, the process takes just a couple of minutes and carries no risk to your personal files or installed programs. For a hands-off approach, turning on Storage Sense will keep temp and junk files from piling up going forward.