Most temporary files are stored in the Windows Temp folder, the location of which differs from computer to computer. Manually cleaning this out in Windows usually takes less than a minute, but it could take longer depending on how large the collection of temporary files is.
How to Delete Temporary Files in Windows
Follow these simple steps to delete your temporary Windows files:
Using a Command Line Command
The steps shown above are considered the normal way to delete temporary files, but you have to do it manually. If you’d rather, you can build your own mini-program that can delete these temp files automatically with a simple double-click/tap of a BAT file. Windows 8.1: Right-click or tap-and-hold the Start button and then choose Run. Windows 8.0: The easiest way to access Run is from the Apps screen. In earlier versions of Windows, choose Start to bring up the search box or find Run. Another way to open the Run dialog box is to enter the WIN+R keyboard shortcut. This command, which is technically one of many environment variables in Windows, will open the folder that Windows has designated as your Temp folder, probably C:\Users[username]\AppData\Local\Temp. If you’re using a keyboard or mouse, click one item and then use Ctrl+A to select every item within the folder. If you’re on a touch-only interface, choose Select all from the Home menu at the top of the folder. This is Windows telling you that the file or folder you’re trying to delete is locked and still in use by a program, or maybe even Windows itself. Skipping these allows the deleting to continue with the remaining data. If you’re getting a lot of these messages, check the Do this for all current items checkbox and then select Skip again. You’ll have to do it once for the file messages and again for the folder ones, but warnings should stop after that. You won’t be prompted when the process is complete. Instead, the progress indicator will just disappear, and you’ll see your empty, or almost empty, temp folder up on the screen. Feel free to close this window. If you happen to be deleting so much data that not all of it can be sent to Recycle Bin, you’ll be told that they’ll be permanently removed. You can do this using the rd (remove directory) Command Prompt command to delete the entire folder and all the subfolders. Type the following command into Notepad or some other text editor, and save it with the .BAT file extension: The q parameter suppresses confirmation prompts to delete the files and folders, and s is for deleting all the subfolders and files in the temp folder. If the %temp% environment variable is for some reason not working, feel free to substitute in the actual folder location mentioned in Step 2 above, but make sure you type the correct folder path, and to be safe, surround the path in quotes like this (change the username, of course):
Other Types of Temporary Files in Windows
The Windows Temp folder isn’t the only place temporary files, and other no-longer-needed groups of files, are stored on Windows computers. The folder you found in Step 2 above is where you’ll find some of the operating-system-created temporary files in Windows, but the C:\Windows\Temp\ folder contains a number of additional files that you no longer need to keep. Feel free to open that Temp folder and delete anything you find in there. The Settings app in Windows 10 has an entire section dedicated to deleting temporary files. Get there through Settings > System > Storage > Temporary files. Included there are things like delivery optimization files, Windows upgrade log files, temporary files left over by apps, and more. Choose what to remove, and then select Remove files. Those same, harder-to-find locations for temporary files are accessible in older versions of Windows, too, like Windows 7, via 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 that in a Run dialog box (WIN+R) via the cleanmgr command.
Check Your Browser Cache
Your browser also keeps temporary files, usually in an attempt to speed up your browsing by loading cached versions of web pages when you revisit them. Review our guide on how to clear your browser’s cache for help deleting these types of temporary files. Ctrl+Shift+Del (Windows) or Command+Shift+Delete (Mac) is usually the shortcut to that option.
Handy Tools for Easy Removal
Dedicated “system cleaners” like the free CCleaner program can make this, and similar jobs, really easy. Many free computer cleaner programs exist to choose from, too, including Wise Disk Cleaner.