How To Get Rid Of Temporary Files In Windows
If you want to free up disk space on your Windows computer, you can delete temporary files. Temporary files are files that your computer only needed temporarily while in use, but are now taking up unnecessary space on your hard drive. These files are typically stored in the Windows Temp folder, although the location of this folder may vary from computer to computer. To manually clean out this folder in Windows, you will need to follow a few simple steps. The amount of time it takes to complete this process will depend on how many temporary files you have.
How to Delete Temporary Files in Windows
To delete temporary files on your Windows computer, you can follow these steps:
1. Locating the temporary files varies depending on the Windows version.
- If you are using Windows 10, you will need to select the Cortana search box located just to the right of the Start button on the taskbar.
- If you are using Windows 8.1, you can right-click or tap-and-hold the Start button and then choose Run.
- If you are using Windows 8.0, you can access Run from the Apps screen.
- In earlier versions of Windows, you can choose Start to bring up the search box or find Run.
- Alternatively, you can open the Run dialog box by entering the WIN+R keyboard shortcut.
2. Once you have opened the Run window or search box, you will need to enter the following command exactly:
%temp%
This command is one of many environment variables in Windows and will open the folder that Windows has designated as your Temp folder, which is usually located at C:\Users[username]\AppData\Local\Temp.
3. Select all the files and folders within the Temp folder that you want to delete. Unless you have a specific reason not to, you can select them all.
If you are using a keyboard or mouse, you can click one item and then use Ctrl+A to select every item within the folder. If you are on a touch-only interface, you can choose Select all from the Home menu at the top of the folder.
It is important to note that you do not need to know what each temporary file you are going to delete is for, or how many files are included in any subfolders you select. Windows will not let you delete any files or folders that are still in use, so there is no risk of accidentally deleting something important.
4. Once you have selected all the temporary files and folders you want to delete, you can delete them by either using the Delete key on your keyboard or the Delete button from the Home menu. Depending on your version of Windows and how your computer is configured, you may be asked to confirm that you wish to Delete Multiple Items, or you may need to select Yes on a special Confirm Multiple File Delete window that appears.
5. If you receive a warning that a file or folder is in use, you can choose Skip to continue with the deletion process.
When attempting to delete a file or folder in Windows, you may encounter a message informing you that the item is locked and still in use by a program or by Windows itself. If this happens, you can choose to skip over these items and continue deleting the remaining data.
If you find that you’re repeatedly encountering this message, you can select the “Do this for all current items” checkbox and then select “Skip” again. Keep in mind that you will need to do this once for the file messages and again for the folder messages, but after that, the warnings should stop.
It’s important to note that it’s rare to see an error message that completely halts the temp file deleting process. However, if this does occur, you can try restarting your computer and attempting to delete the file or folder again. If that doesn’t work, you can try starting Windows in Safe Mode and repeating the steps above.
6. Depending on the number and size of the files you’re trying to delete, the process could take just a few seconds or several minutes. Once the temp files are deleted, the progress indicator will disappear, and you’ll see an empty (or almost empty) temp folder on your screen. You can then close the window.
7. If you’re deleting a large amount of data that can’t be sent to the Recycle Bin, you’ll be informed that the files will be permanently removed. To confirm that you want to delete these items, locate the Recycle Bin on your Desktop, right-click or tap-and-hold the icon, and select “Empty Recycle Bin.“
8. If you can’t find the Recycle Bin, it may have been hidden, but you can still open a hidden Recycle Bin in File Explorer. Once you’ve selected “Empty Recycle Bin,” select “Yes” on the prompt to permanently remove the temporary files from your computer. Your temporary files section will now be empty (at least for the time being).
As a helpful tip, if you want to skip the step of sending files to the Recycle Bin and instead “permanently” delete them, you can hold down the Shift key while deleting the files.
Using a Command Line Command
Although the steps mentioned above represent the standard way of deleting temporary files, it requires manual intervention. Alternatively, you can create a small program that can automatically delete these temp files with a simple double-click/tap of a BAT file.
To do this, you can use the “rd” (remove directory) Command Prompt command to delete the entire folder and all its subfolders. To begin, type the following command into Notepad or another text editor, and save it with the .BAT file extension:
rd %temp% /s /q
The “q” parameter suppresses confirmation prompts for deleting the files and folders, while “s” is used for deleting all subfolders and files in the temp folder.
If the %temp% environment variable is not functioning for any reason, you can use the actual folder location mentioned in Step 2 above. However, ensure that you type the correct folder path, and to be on the safe side, surround the path in quotes like this (make sure to change the username):
rd "C:\Users\jonfi\AppData\Local\Temp" /s /q
Other Types of Temporary Files in Windows
In addition to the Windows Temp folder, there are several other locations on Windows computers where temporary files, and other unnecessary files, are stored.
The folder you found in Step 2 above is where some of the temporary files created by the operating system in Windows are located, but the C:\Windows\Temp\ folder contains additional files that you no longer need. You can access this Temp folder and delete anything you find in there.
Also: How to fix audio issues on Windows 10 and 11
Windows 10’s Settings app includes a dedicated section for deleting temporary files. You can access it by going to Settings > System > Storage > Temporary files. This section includes files like delivery optimization files, Windows upgrade log files, temporary files left over by apps, and more. Select what you want to remove and then click “Remove files.“
The same less-obvious locations for temporary files can also be found in older versions of Windows, such as Windows 7, using Disk Cleanup. This utility is included in all versions of Windows and can help remove the contents of some of those other temp folders for you automatically. You can open it in a Run dialog box (WIN+R) using the “cleanmgr” command.
Check the Cache of Your Browser
In an effort to speed up your browsing by loading cached versions of web pages when you return to them, your browser also saves temporary files. The shortcut to clear your browser cache is usually Ctrl+Shift+Del (Windows) or Command+Shift+Delete (Mac).
You can also delete temporary internet files and cookies in Internet Explorer by going to Tools (gear icon) > Internet Options and selecting Delete under Browsing history. Open the menu in Firefox and navigate to Options > Preferences > Privacy & Security > Clear History. Go to More > More tools > Clear browsing data in Chrome.
By following these simple steps, you can quickly and easily delete temporary files on your Windows computer and free up valuable disk space.