Is your storage space running low? Or is your system slowing down for no reason?
Well, temporary files could be the major cause behind this issue. They can accumulate over time and hog up the storage space slowing down the performance of the system.
So, without further ado let’s learn how to delete temporary files and find out why deleting them is a good idea.
What Are Temporary Files?
Temporary files are the files that are created usually by applications and stored temporarily in a folder known as temp folder. They get deleted automatically as soon as you close the application.
However, these files are constantly being created by various applications and occupy a significant amount of your storage space.
How to Delete Temporary Files
Since the temporary files are mainly stored in the temp folder, you can manually delete their contents. However, there are several ways to do it.
From using disk cleanup to using a BAT file, here are the multiple ways you can delete temporary files.
Using Disk Cleanup
Disk cleanup is a utility program that is used to free up storage space. You can use this tool to easily delete temporary files. Here’s how you can use it.
- Press the Windows + R key and type
cleanmgr
to launch the Disk cleanup. - Under the Drives field, expand the dropdown and select a disk to perform the cleanup.
- Click on OK.
- Wait for the scan to complete.
- Under the Files to delete field, click to check the checkbox that you want to delete.
- Click on OK.
- Repeat the above steps to perform cleanup for other drives.
Delete the Temp Folder Contents
The temporary files are generally stored in the temp folder in Windows. Hence, you can delete the content inside that folder. Here’s how you can do it.
- Press the Windows + R key and type
%temp%
. - Press Enter.
- Select all of the temp folder contents. You can use Ctrl + A keyboard shortcut to do it quickly.
- Press the Delete key.
- On Desktop, find Recycle bin. Right-click on it and select Empty Recycle Bin to delete them permanently.
Alternatively, you can use the shortcut key Shift + Delete to delete them permanently.
Using the Settings App
You can easily remove temporary files in Windows using the Settings app. Here’s how you do it.
- Press the Windows + I key to open the Settings app.
- Navigate to System > Storage.
- On the right pane, click on Temporary files.
- Wait for the scan to finish.
- Click on every checkbox next to the files you want to remove and click the Remove files button.
Use the Storage Sense Feature
Windows has a special feature called Storage Sense that helps to remove temporary files. You can even configure it to run automatically on specific days or weeks or even when your hard disk runs low on storage.
Here’s how you can enable it in the Settings app.
- Press the Windows + I key to open the Settings app.
- Under the Storage section and below the text, Storage Sense can automatically free up space by getting rid of files you don’t need, like temporary files and content in your recycle bin; toggle the button to On.
- Additionally, you can go to Configure Storage Sense or run it now to change its settings according to your preferences.
Using a BAT File
You can execute a BAT file to automatically delete temporary files. However, you need to create one and type some commands inside it. To create this file,
- Right-click and select New > Text Document.
- Enter the command
rd %temp% /s /q
. - Click on File > Save as. You can give any name to this text file.
- Add the .bat extension at the end of the file name.
- Also, set the Save as type to All Files option.
- Click on the Save button.
Double-click the bat file whenever you want to delete the temporary files and they will be deleted automatically.
Delete the Prefetch Folder Contents
Prefetch is a memory management feature that keeps track of applications that you use most frequently in a log file. You can delete the content inside the Prefetch folder to clear the temporary files from your system. Here’s how you can remove them.
- Press the Windows + R key and type
prefetch
. - Select all of the Prefetch folder contents. You can use Ctrl + A keyboard shortcut to do it quickly.
- Press the Delete key and right-click on the Recycle bin, and select Empty Recycle Bin to delete them permanently.
Clear the Browser Cache
Browsers create a cache of images and other files of the frequently visited sites so that they can load the website quickly. However, if you extensively use the browser in your day to day use then the cache files can pile up very quickly. Here’s how you can easily clear browser cache and restore your storage space.
On Chrome
- Click on the three dots at the top-right corner of the window.
- Hover the cursor on More tools and click on the Clear browsing data option.
- Click on the checkbox next to Browsing history, Cookies and other site data, and Cached images and files.
- Choose the All-time option in the Time range dropdown if you feel comfortable.
On Firefox
- Click on the hamburger icon at the top-right corner of the window.
- Click on the Settings option.
- On the left sidebar, click on Privacy & Security.
- Scroll down to the Cookies and Site Data section and click on the Clear Data button to clear all the cookies and site data.
- Also, scroll down to the History section and click on the Clear History button to clear all your history.
On Safari Browser
- Open the safari browser.
- On the top menu, click on Safari and then Preferences.
- Click on Privacy.
- Click on Manage Website data.
- Now, click on Remove Now.
How to Delete Temporary Files on Mac
You can easily delete temporary files on Mac too. Here’s how you can do it.
- Click on the Go menu at the top of the desktop screen.
- Select the Go to folder option and type ~/Library/Caches on the search bar.
- Click on Ok
- Select all the items inside the folder.
- Right-click and select the Delete immediately option.
You can also follow our comprehensive guide on how to clear cache on iPhone and iPod.
Frequently Asked Questions
How Often Should I Clear the Temporary Files?
There is no hard and fast rule and time to clear the temporary files. It completely depends upon your preference. However, a good rule of thumb is to delete them every once in a while.
Is It Safe to Delete Temporary Files?
It’s perfectly safe to delete the temporary files as it contains only the data stored by the applications for temporary use. And, it doesn’t include any crucial system files.
Furthermore, sometimes when a program is being installed, it can store something it needs to complete the installation after a reboot. So, it is recommended to only delete those files after the program installation has been completed.