As you use your Windows 11 / Windows 10 computer, it creates temporary files to store information that helps it run more efficiently. These files can include things like browser history, cookies, and other data. Over time, these temporary files can accumulate and take up valuable storage space on your computer.
This guide will show you how to delete temporary files in Windows 10 / Windows 11 (aka. temp files or tmp files) using several different methods, including the Disk Cleanup tool and the Run command. By clearing these files and folders, you can free up storage space and improve the performance of your computer.
With these methods, you can select temporary files you want to remove and clean up folders that are taking up unnecessary space on your computer. Here's how to clear temporary Windows files and free up space on your local disk.
What are Temporary Files in Windows?
Temporary files in Windows 11 / Windows 10 are files created to store information needed for a short period by Windows or certain apps. These files can include things like browser history, cookies, and other data. Over time, these files can accumulate and take up valuable storage space on your computer. Deleting these temporary files can free up storage space and improve your computer's performance.
It is unnecessary to be aware of the purpose of each temporary file that will be deleted or the number and type of files contained in any subfolders chosen. Windows will not permit the deletion of files or folders currently being utilized.
⚠️ Please note: The process described below is the same in Windows 11 as it is in Windows 10. However, bear in mind that we'll be using screenshots from Windows 11, so your UI may look a little different. We'll point out any changes you need to be aware of as they come up.
How To Delete Temporary Files in Windows 10 / Windows 11 through File Explorer
- Open the temp file folder
Click on the “Windows” icon, type “%temp%” in the search bar, and click on the temporary files folder. - Select all temporary files (and tmp file folders) and click on the “Delete” icon at the top, as shown in the picture
- A notification box will appear showcasing the discovered items that you are deleting
- Skip granting admin permission if asked
If Windows asks for admin permission, it might mean that the file is currently being used or will be required by the system or the related app.
- Right-click on “Recycle Bin” and select “Empty Recycle Bin” from the context menu options
All the deleted files will still be stored in the Recycle Bin. To permanently clear the temporary files you need to empty the Recycle Bin.
How to Delete Temporary Files Using the Command Line
You can delete all the temporary files using the following CMD command. We will use a “.BAT” file to generate the specific command for your PC to make things easier. Advanced users might skip this step and put the needed command directly.
What is the “.BAT” file format in Windows?
A .BAT file is a batch file in Windows. It is a script file containing a series of commands executed in order by the operating system's command interpreter (cmd.exe). These files typically have the file extension “.bat” or “.cmd” and can automate repetitive tasks, such as setting environment variables, running multiple programs, or deleting temporary files. They can also be used to create simple scripts to perform various functions on a Windows computer, such as shutting down or restarting the system, running a program, or performing a series of operations in a specific order.
- Type in the following command in “Notepad” or any other text editor
rd %temp% /s /q
- Click on the “Windows” icon, type “%temp%” in the search bar, and click on the temporary files folder
- Copy the temporary files folder path as shown in the picture
- Paste the copied path of temporary files inside the command, as shown in the picture
It would look like this:
rd "TEMPORARY FILE FOLDER PATH" /s /q
- Click on “File” to open the menu and select “Save As…”
- Type in the file name as you'd like with the “.BAT” extension, and click “Save”
- Double-click the “.BAT” file
Windows will execute the command inside the “.BAT” file and delete all the temp files on your PC.
How to Find Other Types of Temporary Files in Windows 11 or Windows 10
The Windows Temp folder is just one location where temporary files and other potentially obsolete types of files are stored on Windows computers. You can also find such files in other locations. It is safe to delete the files in the “C:\Windows\Temp” folder.
- Open “File Explorer” and type “C:\Windows\Temp” in the search bar to access other temporary files
Repeat the same steps shown previously to select and delete also the files in “C:\Windows\Temp” and maybe other temp file folders that might specifically exist on your PC in certain app folders.
FAQ – Frequently Asked Questions About Deleting Temporary Files on Windows
How can I view the size of temporary files before deleting them in Windows 11 or Windows 10?
In File Explorer, after searching for “%temp%“, you can select all files and right-click to choose “Properties” to view the total size of the selected temporary files.
What are the implications of not granting admin permission when prompted during temp file deletion?
If you skip granting admin permission, some temporary files that require higher privileges for deletion might not be removed, potentially leaving some space occupied.
Can I recover deleted temporary files in Windows 11 or Windows 10 if I need them back?
Once temporary files are deleted and the Recycle Bin is emptied, recovering them would require third-party data recovery tools, and success is not guaranteed.
Is it possible to exclude certain types of temporary files from deletion in Windows 11 or Windows 10?
Manual deletion through File Explorer allows you to selectively delete files, but automated methods like Disk Cleanup and batch scripts don't offer fine-grained control over file types.
How do I handle “Disk is almost full” alerts related to temporary files on Windows 11 or Windows 10?
First, delete temporary files using the methods described in this tutorial. If alerts persist, consider using Disk Cleanup to remove other unnecessary files or upgrading your storage.
Are there any system settings in Windows 11 or Windows 10 to manage temporary files automatically?
Windows 10 and 11 include a Storage Sense feature that can be configured to automatically delete temporary files and manage storage space more efficiently.
How do temporary files affect SSDs differently than HDDs in Windows 11 or Windows 10?
While temporary files can fill up storage on both SSDs and HDDs, SSDs can suffer from reduced performance and lifespan due to excessive write operations, making regular temp file cleanup more crucial.
What's the difference between using the “%temp%” command and navigating to “C:\Windows\Temp”?
The “%temp%” dynamic location opens the current user's temp folder, while “C:\Windows\Temp” contains system-level temporary files, both of which can be cleared to free up space.
Can disabling certain Windows features or services reduce the amount of temporary files generated?
Yes, disabling features like Windows Search or certain background apps can reduce temporary file generation, but it may also limit functionality.
How do updates in Windows 11 or Windows 10 impact temporary files?
System updates can create additional temporary files and sometimes leave behind old versions of files, making post-update cleanup beneficial.
Is it beneficial to delete temporary files before installing new software or updates in Windows 11 or Windows 10?
Clearing temporary files can prevent potential conflicts and free up space, which might facilitate smoother installation of new software or updates.
Can antivirus or antimalware scans interfere with deleting temporary files in Windows 11 or Windows 10?
Active scans might temporarily lock certain temp files, making them undeletable until the scan is complete. It's best to delete temp files when scans are not running.
What role do temporary files play in troubleshooting Windows 11 or Windows 10 issues?
Some temporary files can contain logs and error reports useful for troubleshooting, but they can often be safely deleted if not actively diagnosing issues.
Are there any privacy concerns associated with not regularly deleting temporary files in Windows 11 or Windows 10?
Temporary files can contain sensitive information, such as browsing history and document previews, so regular deletion can enhance privacy.
How does using cloud storage services interact with the generation and management of temporary files in Windows 11 or Windows 10?
Cloud services may store temporary files locally to improve performance, which should also be managed as part of regular temp file cleanup routines.
Related: How to Use Windows Disk Cleanup in Classic and Extended Mode to Free up Space
Running Disk Cleanup in Windows can free up space by deleting files that you don't need. The most savings are often found by deleting previous Windows installations and files left in the recycle bin, but it also looks for temporary internet files, thumbnails, error reports, and more.
Last Updated on April 21, 2024 3:30 pm CEST