Complete Guide: How to Delete Temporary Files in Windows 10

How to Delete Temporary Files in Windows 10 blog banner image

Temporary files in Windows take up valuable disk space and can slow down your system over time. While these files serve important functions during active processes, they often remain long after you need them. To maintain optimal system performance and storage space, you need to know how to delete temporary files in Windows 10, including which files are safe to remove and how to automate the cleanup process.

What are temporary files in Windows 10?

Temporary files first appeared in early Windows versions to handle short-term data storage needs. When you open applications or browse websites, Windows creates temporary files to store information like partially completed downloads, session data, and cached images.

Windows 10 generates several types of temporary files during routine operations. These include:

  • Installer files that remain after software updates.
  • Browser cache files that store webpage data.
  • System files that are created during Windows updates.
  • Print spooler files accumulate when documents queue for printing.
  • Crash dump files that appear after application errors.

The Windows operating system typically manages these files automatically, but the cleanup process doesn’t always work as expected. This leads to unnecessary storage consumption over time, especially on systems with limited disk space.

Where to find temporary files?

Locating temporary files across your Windows system requires understanding several key directories. You access most temp locations through File Explorer or specific system shortcuts.

Common temporary file locations

The primary locations for temporary files include:

  • The Windows Temp folder stores system-level temporary data at “C:\Windows\Temp”, which contains installation files and system update remnants that persist after updates are complete.
  • Your user account has a dedicated temp folder at “C:\Users\YourUsername\AppData\Local\Temp” where applications store session data and temporary configuration files during runtime.

User-specific temp folders

To access hidden temp folders quickly:

Open the Run dialog box and press “Windows key + R.”

  • Access your user temp folder:
    • Type “%temp%” in the Run dialog and press Enter.
    • This opens the temporary folder specific to your user account.
  • Access the system-wide temporary directory:
    • Type “temp” in the Run dialog and press Enter.
    • This opens the folder containing temporary files used across the system.

Accessing these folders directly allows you to clear temporary files manually, freeing up space and resolving potential issues.

Windows system temp files

The Windows prefetch folder at “C:\Windows\Prefetch” maintains data that helps applications launch faster, though these files regenerate as needed. The Software Distribution folder at “C:\Windows\SoftwareDistribution” contains Windows Update files that remain after system updates.

Application cache directories

Application caches occupy significant space across different locations. Browser caches typically reside in the AppData folders, with each browser maintaining its own cache directory. Microsoft Edge, Chrome and Firefox all store cached web content differently, impacting how you clear temporary files in Windows 10.

Step-by-step guide: How to delete temporary files in Windows 10

Windows 10 provides multiple methods to remove temporary files from your system. From built-in utilities to manual processes, each approach offers different benefits depending on your needs. Let’s explore the most effective ways to delete temporary files and reclaim valuable disk space.

Use the Disk Cleanup utility

The built-in Disk Cleanup utility offers the quickest way to delete temporary files in Windows 10. Right-click any drive, select “Properties” and click “Disk Cleanup.” Select “Clean up system files” for a comprehensive scan. Check boxes for “Temporary files,” “Windows update cleanup” and “Windows upgrade log files” to free up the most space.

Manual deletion process

While automated tools handle most cleanup tasks, manual deletion gives you precise control. Open File Explorer and navigate to these key locations:

  • Type “%temp%” in the Run dialog (Windows key + R) to access user temporary files.
  • Navigate to “C:\Windows\Temp” for system-wide temporary files.
  • Check “C:\Windows\Prefetch” for application launch data.

Select files, right-click and choose “Delete.” Some files may be in use, so skip these to avoid system issues.

Third-party cleanup tools

CCleaner and BleachBit offer advanced features for managing temporary files. These tools scan additional locations and provide detailed control over cleanup operations. However, built-in Windows tools are enough for most users who want to clear temporary files in Windows 10.

Setting up automatic temporary file management

Learning how to delete temporary files in Windows 10 isn’t complete without setting up automatic maintenance. Windows 10 includes a built-in utility called Storage Sense, alongside other tools, to help manage disk space automatically. This comprehensive system provides multiple ways to keep your temporary files under control.

Schedule cleanup tasks

Create a scheduled task through Task Scheduler to run Disk Cleanup automatically:

  • Open Task Scheduler by typing “taskschd.msc” in the Run dialog.
  • Select “Create Basic Task” and choose your preferred schedule.
  • Set the action to run “cleanmgr.exe” with the “/sagerun:1” parameter.

Storage Sense settings

Built directly into Windows 10, Storage Sense automatically manages disk space:

  • Navigate to “Settings > System > Storage.”
  • Toggle “Storage Sense” to “On.”
  • Click “Configure Storage Sense or run it now” for additional options.
  • Choose how often Windows should delete temporary files.
  • Set rules for Downloads folder cleanup and emptying the Recycle Bin.

Custom cleanup rules

Windows Task Scheduler supports advanced rules for temporary file management:

  • Create filters based on file age using “forfiles” commands.
  • Exclude specific file types or folders from automatic deletion.
  • Set size-based triggers to clear temp files when space runs low.

Monitoring space usage

Track storage trends through Windows built-in tools:

  • Open Settings and select “System > Storage” to view usage by category.
  • Check “Storage usage” for detailed breakdowns by file type.
  • Review cleanup recommendations provided by Windows.

Identifying safe-to-delete vs. critical temporary files

Understanding which temporary files to remove helps prevent system issues. While Windows creates many temporary files, some play essential roles in system stability and performance.

Safe temporary files to delete

These files can be safely removed to clear temporary files in Windows 10:

  • Files in your user “%temp%” folder older than 24 hours.
  • Browser cache files and downloaded installers.
  • Windows Update delivery optimization files.
  • Old Windows Defender scan results.
  • Windows error reporting files.

Critical files to preserve

Exercise caution with these temporary file locations:

  • Active “hiberfil.sys” and “pagefile.sys” in the root directory.
  • Current Windows Update files in “C:\Windows\SoftwareDistribution.”
  • Files in use by running applications.
  • System restore points unless explicitly clearing space.

Best practices

When managing temporary files:

  • Use built-in Windows tools rather than manual deletion.
  • Never delete files from “System32” directory.
  • Wait 24 hours after major system updates before cleanup.
  • Create a system restore point before bulk deletions.
  • Check running processes before removing temp files.

Keeping your Windows system free of unnecessary temporary files helps maintain optimal performance and storage space. Whether you choose Windows’ built-in utilities like Storage Sense and Disk Cleanup or set up custom automated tasks, regular maintenance of temporary files ensures your system runs smoothly while preserving critical system operations.

Take control of your entire IT infrastructure with NinjaOne’s comprehensive endpoint management platform. From automated maintenance to real-time monitoring, streamline operations across all your devices. Start your free trial today and experience enterprise-grade endpoint management made simple.

Next Steps

Building an efficient and effective IT team requires a centralized solution that acts as your core service deliver tool. NinjaOne enables IT teams to monitor, manage, secure, and support all their devices, wherever they are, without the need for complex on-premises infrastructure.

Learn more about Ninja Endpoint Management, check out a live tour, or start your free trial of the NinjaOne platform.

You might also like

Ready to simplify the hardest parts of IT?
×

See NinjaOne in action!

By submitting this form, I accept NinjaOne's privacy policy.

NinjaOne Terms & Conditions

By clicking the “I Accept” button below, you indicate your acceptance of the following legal terms as well as our Terms of Use:

  • Ownership Rights: NinjaOne owns and will continue to own all right, title, and interest in and to the script (including the copyright). NinjaOne is giving you a limited license to use the script in accordance with these legal terms.
  • Use Limitation: You may only use the script for your legitimate personal or internal business purposes, and you may not share the script with another party.
  • Republication Prohibition: Under no circumstances are you permitted to re-publish the script in any script library belonging to or under the control of any other software provider.
  • Warranty Disclaimer: The script is provided “as is” and “as available”, without warranty of any kind. NinjaOne makes no promise or guarantee that the script will be free from defects or that it will meet your specific needs or expectations.
  • Assumption of Risk: Your use of the script is at your own risk. You acknowledge that there are certain inherent risks in using the script, and you understand and assume each of those risks.
  • Waiver and Release: You will not hold NinjaOne responsible for any adverse or unintended consequences resulting from your use of the script, and you waive any legal or equitable rights or remedies you may have against NinjaOne relating to your use of the script.
  • EULA: If you are a NinjaOne customer, your use of the script is subject to the End User License Agreement applicable to you (EULA).