Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Safely Clean Up Temporary Files in Windows

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Cleaning up temporary files in Windows is a quick way to free disk space, speed up your system, and resolve odd errors caused by corrupted temp data. This guide walks you through the built-in tools and manual methods to safely remove temp files without deleting anything important. You don’t need any special software—just a few minutes and a Windows account with administrator rights (for some steps).

What You'll Need

  • A Windows PC (Windows 10 or Windows 11 recommended, but steps work for Windows 8/8.1)
  • An administrator account (for clearing system temp files and using Disk Cleanup fully)
  • Backup of any files you’re unsure about (optional but wise)

Step-by-Step

  1. Close all running programs. Before you start, save your work and close any open applications. This prevents files from being locked and ensures that temp files in use are not deleted while the program is running.
  2. Open the Settings app. Press Windows + I to open Settings. If that doesn’t work, click the Start button and then the gear icon.
  3. Navigate to Storage settings. In Windows 11, go to System > Storage. In Windows 10, go to System > Storage as well. This page shows a breakdown of what’s using space on your drive.
  4. Open Temporary files. Under the “Storage” section, you’ll see a list of categories. Click on Temporary files. If you don’t see it, click “Show more categories” or scroll down.
  5. Review the list. Windows will scan and display items like “Temporary files,” “Downloads,” “Empty recycle bin,” and “Thumbnails.” Check the boxes for the items you want to remove. Usually, you can safely select all of them, but be cautious with “Downloads” if you have files there you need.
  6. Click “Remove files.” After selecting, click the Remove files button. Windows will delete the selected items. This may take a few minutes depending on the amount of data.
  7. Use Disk Cleanup (for older Windows or more options). If you prefer the classic tool, search for “Disk Cleanup” in the Start menu and open it. Select the drive you want to clean (usually C:) and click OK. Wait for it to scan, then check the boxes for “Temporary files,” “Temporary Internet Files,” “Thumbnails,” and “Recycle Bin.” Click OK and then “Delete Files.”
  8. Clear the temp folder manually (optional). Press Windows + R to open the Run dialog. Type %temp% and press Enter. This opens the temp folder for your user account. Select all files (Ctrl + A) and press Delete. If you get a “file in use” error, skip those files by clicking “Skip” or unchecking them. This is safe because these are only temporary files.
  9. Clear the system temp folder (optional, requires admin). In the Run dialog, type temp and press Enter. This opens the system temp folder. You’ll need administrator permission. Select all and delete. Again, skip any files that are in use.
  10. Empty the Recycle Bin. After deleting files, right-click the Recycle Bin on your desktop and select “Empty Recycle Bin.” This permanently removes the deleted files, freeing up more space.
  11. Restart your computer. A restart clears any remaining temp files that were locked and refreshes system processes. This is a good practice after a cleanup.

Common Mistakes

  • Deleting files that are in use. If a program is running, its temp files are locked. Forcing deletion can cause crashes or data loss. Always close programs first, and skip files that give errors.
  • Clearing the “Downloads” folder without checking. The Storage settings list includes “Downloads.” If you have important files there, uncheck that box. It’s easy to accidentally delete your only copy.
  • Using third-party “cleaner” software. Many “PC cleaner” programs are unnecessary and can sometimes remove important system files. Windows built-in tools are sufficient and safer.
  • Deleting the entire Windows folder. Never manually delete files from C:\Windows unless you are absolutely sure. Stick to the temp folders mentioned above.
  • Not restarting after cleanup. Some temp files are only removed on reboot. Skipping the restart leaves junk behind.

Tips

  • Use Storage Sense (Windows 10/11). In the Storage settings, you can turn on Storage Sense to automatically clean up temp files and recycle bin contents on a schedule. This prevents buildup.
  • Check for large temp files. In the Temporary files screen, you can click on each category to see its size. If “Temporary files” is huge, it might be due to a specific app misbehaving. You can investigate which app is creating them.
  • Clean up after updates. Windows Update leaves behind old installation files. After a major update, run Disk Cleanup and select “Windows Update Cleanup” to remove them.
  • Be careful with the “Delivery Optimization Files.” These are used for Windows Update sharing. You can delete them, but they will be recreated if needed. It’s safe to remove.
  • Use the Command Prompt for a thorough clean (advanced). Open Command Prompt as administrator and run cleanmgr /sageset:1 to customize Disk Cleanup options, then cleanmgr /sagerun:1 to run them. This gives you more control.

Troubleshooting

“You don’t have permission to delete some files.” This usually means the file is in use or you need admin rights. Close all programs, then try again. If it persists, restart and try immediately after booting.

“The action can’t be completed because the file is open in another program.” This is normal for temp files. Click “Skip” to leave those files. They will be removed next time you clean up after closing the program.

Disk Cleanup is stuck or very slow. If it takes more than 10 minutes, it might be scanning a large drive. Wait a bit longer. If it truly hangs, close it and restart your PC, then try again.

Storage settings show “Temporary files” but the Remove button is grayed out. This can happen if the scan is still running. Wait a few seconds, or close and reopen Settings.

After cleanup, you still have very little free space. Check for other large files using the Storage settings. Look at “Apps & features” to uninstall unused programs, or use “System Restore” and “Shadow Copies” cleanup in Disk Cleanup (under “More Options” tab).

You accidentally deleted a file you needed. If you emptied the Recycle Bin, you might be able to restore it from a backup or use File History if enabled. Otherwise, stop using the drive immediately and consider data recovery software—but act fast.

Frequently Asked Questions

Q: Is it safe to delete all files in the %temp% folder?
A: Yes, mostly. These are temporary files created by apps and Windows. If a file is in use, you’ll get an error and can skip it. Deleting them will not harm your system, but it may cause some apps to recreate them next time they run.

Q: How often should I clean temporary files?
A: Once a month is a good rule of thumb, or whenever you notice low disk space. If you use Storage Sense, it can do it automatically.

Q: Will cleaning temp files speed up my PC?
A: It can free up disk space, which helps if your drive is nearly full. However, it won’t dramatically boost performance if you already have plenty of free space. It can also fix issues caused by corrupted temp files.

Q: Can I delete the “Windows Update Cleanup” files?
A: Yes, these are old update files that are no longer needed. Deleting them is safe and can free up several gigabytes.

Q: What’s the difference between “Temporary files” in Settings and the %temp% folder?
A: The Settings “Temporary files” category includes several types of temp data (like thumbnails, recycle bin, and update files). The %temp% folder is specifically for your user account’s temp files. Both are safe to clean.

Q: Do I need third-party software to clean temp files?
A: No. Windows built-in tools are sufficient and safer. Third-party tools often come with ads or bundled software and may delete files you need.