
Contents
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 / 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.
Extra: 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.