Imagine you bought a new laptop a few months ago. Initially, everything ran like a dream – apps opened in seconds, boot-up was fast, and the C: drive showed plenty of free space. But after a while, the PC suddenly seemed to slow down; the C: drive indicator turned red, and “Low Disk Space” warnings started popping up. Why? Because a heap of temporary files – Windows updates, app caches, installation files, browser data – had accumulated in the background, quietly eating up your storage. If you want to know how to delete temporary files in Windows 11 – and do it automatically – then this guide is for you.

What are temporary files, and why do they accumulate?
Whenever you install software, search for something in a browser, run Windows Update, or use an app, temporary files are created; over time, these accumulate and consume valuable storage space.
In Windows 11, temporary files are primarily stored in these locations:
- User Temp folder: C:\Users\YourUserName\AppData\Local\Temp
- System Temp folder: C:\Windows\Temp
- Windows Update Cache: C:\Windows\SoftwareDistribution
- Prefetch folder: C:\Windows\Prefetch
- Browser cache: Chrome, Edge, and Firefox each have their own separate cache folders.
Temporary files, such as cached data and installation leftovers, can accumulate over time. Regularly deleting these files prevents clutter and improves system performance.
Delete Temporary Files in Windows 11 – 6 Methods (Manual + Automatic)
Method 1: Delete temporary files via the Settings app (easiest)
This is the most straightforward method. To easily clear temporary files in Windows, go to Settings > System > Storage > Temporary files.
Step-by-step:
- Open the Settings app by pressing Win + I, and go to System > Storage.
- Click on Temporary files.
- Windows will display a list of various temporary files, along with the amount of storage each category is consuming.
- Select the files you want to remove using the checkboxes. Once selected, the total occupied storage will be displayed at the top.
- Click the Remove files button.
Important: Keep Downloads unchecked, as removing it may permanently delete all files in your Downloads folder.
Note (Windows 11 24H2 update): Starting with Windows 11 build 26100.7705 (24H2) and build 26200.7705 (25H2), a UAC (User Account Control) prompt now appears when opening Storage settings (Settings > System > Storage). In the new builds, this prompt appears only when viewing Temporary files, not for the entire page.
Method 2: Set up automatic cleanup with Storage Sense (best practice)
If you want Windows 11 to automatically clear temporary files, Storage Sense is the best option. Storage Sense is a great way to manage your computer’s storage in Windows 11. When configured, it automatically empties the Recycle Bin, deletes temporary files, and performs other tasks to keep storage organized.
How to turn on Storage Sense:
- Open Windows Settings using the Win + I keyboard shortcut, then select System and click on Storage.
- Under Storage management, turn on the switch next to Storage Sense.
- Click on Storage Sense to view additional settings.
Configuration options:
- Under “Cleanup of temporary files,” select the checkbox for “Keep Windows running smoothly by automatically cleaning up temporary system and app files.”
- Turn on the “Automatic User content cleanup” option to configure the cleanup schedule.
- You can choose from the following options in the “Run Storage Sense” drop-down menu: Every day, Every week, Every month, or During low free disk space.
Windows 11 will automatically clear temporary files based on your selected time slot. If you wish to clean them immediately, you can click the “Run Storage Sense now” button.
Limitations of Storage Sense:
Storage Sense handles only specific types of files – such as the Recycle Bin, the Downloads folder, temporary system files, and OneDrive content. It does not touch browser caches; if you use Chrome or Firefox, these caches can grow to several gigabytes in size. It also skips app-specific temporary files generated by applications like Teams, Spotify, and Discord. Another blind spot is the user’s “Temp” folder, where apps often dump files that they never clean up themselves.
Method 3: Manual cleanup using the Run command (%temp%)
This method is old but remains very useful today:
- Open the Run prompt by pressing Win + R. Type %temp% and press Enter.
- This will open the Windows Temp folder location in your user directory.
- Select all the files using the Ctrl + A keyboard shortcut and delete them.
Next, type “temp” in the Run dialog box and clean out that temporary folder as well.
You might encounter errors stating that certain files cannot be deleted; you can safely skip these prompts. Such errors usually occur when a program is still actively using the temporary file in question.
Method 4: Delete temp files using Command Prompt / PowerShell
If you prefer the command line, this method is fast and effective:
- Type ‘cmd’ or ‘Terminal’ in the Start menu.
- Select ‘Run as Administrator’.
- Paste this command:
del /q/f/s %TEMP%\*and press Enter. - The temporary files will be removed from your computer.
Run this for the system-wide Temp folder as well:
del /q /f /s C:\Windows\Temp\*In the del /q/f/s %TEMP%\* command, the /q flag suppresses confirmation prompts, /f forces the deletion of read-only files, and /s handles subfolders.
Method 5: Cleaning up with Disk Cleanup (Cleanmgr)
Windows’ classic Disk Cleanup tool is still effective today:
- Click the Windows Start button or use the Win + S keyboard shortcut. Type “Disk Cleanup,” select Disk Cleanup from the search results, and click “Run as administrator.”
- Select the C: drive and click OK.
- Review categories such as Temporary Files, Temporary Setup Files, Downloaded Program Files, Temporary Internet Files, and Thumbnails.
- For a deeper scan, select “Clean up system files,” then select the drive again and click OK.
Important: Pay attention to previous Windows installation(s). Removing this will delete Windows.old and eliminate the option to roll back to the previous Windows version.
Method 6: Full Automation using Task Scheduler + Batch Script (Advanced)
This method is for those who want all temporary files to be cleaned automatically – without any manual intervention – either upon PC startup or on a weekly basis.
Step 1: Create a Batch Script
Open Windows Search (Win + S), type “Notepad,” and launch the app. Type the following code into the new Notepad file:
@echo off
echo Cleaning temporary files...
del /s /f /q %TEMP%\*.* >nul 2>&1
rd /s /q %TEMP% >nul 2>&1
md %TEMP%
del /s /f /q C:\Windows\Temp\*.* >nul 2>&1
rd /s /q C:\Windows\Temp >nul 2>&1
md C:\Windows\Temp
echo Temporary files cleared!This script removes temporary files from both your user account’s temporary folder and the system-wide temporary folder.
Save it as CleanTemp.bat using File > Save As (set “Save as type” to “All Files”).
Step 2: Schedule it in Task Scheduler.
- Open the app by typing “Task Scheduler” in the Windows search box.
- Select “Create Basic Task” from the Actions pane on the right.
- Name the task (e.g., “Automatic Temp Cleanup”) and add a brief description.
- Choose the frequency for the task – Daily, Weekly, or Monthly – then click Next.
- Select the “Start a program” option and click Next.
- Click Browse and select your CleanTemp.bat file.
- Click Finish.
To run it at PC startup:
Right-click on your task and select “Properties,” open the “Triggers” tab, and click “New.” Select the “Begin the task” drop-down menu and choose “At startup.” Click “OK” at the bottom, then click “OK” again to save the changes.
If you ever need to disable this functionality, right-click on your task in Task Scheduler and select “Disable.” To remove the task completely, right-click on it and select “Delete.”
Disk Cleanup + Task Scheduler Combo (Bonus Method)
Windows 10 and Windows 11 feature a built-in automatic cleanup tool called Storage Sense; combining it with Task Scheduler or the classic Disk Cleanup (cleanmgr) utility offers more granular control.
How to do it:
- First, create a Disk Cleanup preset: open an elevated Command Prompt and type
cleanmgr /sageset:1. - Select the categories you want to clean and click OK.
- Then, open Task Scheduler and select “Create Basic Task.”
- Browse to start a program/script and select
C:\Windows\System32\cleanmgr.exe. Type/sagerun:1in the “Add arguments” section.
A good baseline: Weekly Disk Cleanup (cleanmgr /sagerun:1), scheduled for Sundays at 3:00 AM, set to run only when the system is idle.
Keep this in mind before deleting temporary files in Windows 11
There are a few things that are very important to keep in mind:
- Do not delete the Prefetch folder; it contains data that Windows uses to launch programs quickly. Deleting it may slightly slow down app launches until Windows regenerates the files.
- Handle the Downloads folder with care; do not set Downloads to auto-delete in Storage Sense unless you have backed up important files elsewhere.
- Microsoft’s documentation specifically recommends deleting temporary files that haven’t been modified in the last week. This is safer than simply deleting every file in every Temp folder.
- Delete the Windows.old folder cautiously; doing so will remove the option to roll back to a previous version if you have recently upgraded Windows.
Some useful free tools
If you are not satisfied with the built-in methods, you can also try these free third-party tools:
- BleachBit (free, open-source) – Cleans everything: browser cache, app cache, log files.
- TreeSize Free – Visually shows which folders are taking up the most space.
- WizTree – Similar to TreeSize but much faster; reads the MFT (Master File Table) directly.
Visit fixtech.in for more PC optimization tips and Windows troubleshooting guides.
Which method to use when? – Quick comparison
| Method | Best Use Case | Automatic? | Difficulty |
|---|---|---|---|
| Settings > Temporary files | Quick manual cleanup | ❌ No | Easy |
| Storage Sense | Set-and-forget automation | ✅ Yes | Easy |
| Run (%temp%) | Fast Manual Clean | ❌ No | Easy |
| CMD / PowerShell | Tech-Savvy Cleanup | ❌ No | Medium |
| Disk Cleanup | Deep System Cleanup | ❌ No | Easy |
| Task Scheduler + Script | Full automation | ✅ Yes | Advanced |
FAQs – Delete Temporary Files in Windows 11
Q1. How do I delete temporary files in Windows 11 – what is the easiest way?
The easiest way is to go to Settings > System > Storage > Temporary files. Select the files using the checkboxes and click Remove files.
Q2. Are there any downsides to enabling Storage Sense?
Storage Sense is a simple automation feature that keeps your system free of unnecessary temporary files. It is safe for most users and helps maintain available disk space without requiring manual cleanup. Just give it some thought before setting the Downloads folder to auto-delete.
Q3. Will deleting temp files break any programs?
Generally, no. Some files won’t be deleted if a program is currently using them – you can safely skip these prompts. This error occurs when a program is still actively using that specific temporary file.
Q4. What is the difference between %temp% and C:\Windows\Temp?
%TEMP% is an environment variable that points to your current user’s temporary folder, whereas C:\Windows\Temp is the system-wide temporary folder.
Q5. How often should Storage Sense run?
You can run Storage Sense on a Daily, Weekly, or Monthly schedule. For most users, Weekly or During low free disk space works best.
Q6. Does Storage Sense also clear the browser cache?
No, Storage Sense does not touch the browser cache. If you use Chrome or Firefox, this cache can grow to several gigabytes. To clear the browser cache, use the browser’s own settings or a tool like BleachBit.
Q7. Can I run a Task Scheduler script at PC startup?
Yes, in Windows 11, you can run your script when the PC starts up or shuts down. To run a script when the PC starts, open Task Scheduler and select “At Startup” under Triggers.
Conclusion
So, these are 6 ways to delete temporary files in Windows 11 – whether manually or fully automatically. The easiest method is enabling Storage Sense – simply set it up once and forget about it. If you prefer more control, you can set up full automation using a combination of a Batch Script and Task Scheduler.
Prolonged use of a Windows system leads to the accumulation of temporary files, which not only consume valuable storage space but also impact system performance. While you can clean them up manually from time to time, automating the process saves time.
Make regular cleanup a habit, configure Storage Sense, and keep your Windows 11 PC fast and clutter-free. For more PC optimization guides, troubleshooting tips, and all kinds of Windows 11-related assistance, be sure to visit fixtech.in – where you’ll find detailed content on topics like deleting temporary files in Windows 11!
