GUIDE Windows 11 / 10 Storage Troubleshooting • 100% Native CMD & Portable 1-Click Fix
TECHNICAL GUIDE • STORAGE RECOVERY

How to Clean Temp Files in Windows 11 & Fix "Low Disk Space" Error

⚡ Quick Answer: How to Safely Clean Windows Temp Files
To clean user temp files, press Win + R, type %temp%, press Enter, press Ctrl + A, and hit Shift + Delete. If Windows displays "The action can't be completed because the file is open in another program", simply check "Do this for all current items" and click Skip. To purge system-level temp files, Windows Update caches, and memory crash dumps automatically without permission errors, use the free 56 KB portable Pexoris Temp Cleaner.

Why Does Windows Accumulate Tens of Gigabytes in Temp Folders?

Over weeks and months of routine computer use, Windows silently hordes huge quantities of temporary files across several distinct locations. Every time an application runs, unzips an update, or extracts an installer, it stages files in your temporary directories. While software is supposed to delete these staging files upon closing, poorly written installers, system crashes, and hard shutdowns frequently leave orphan files behind forever.

The 5 Major Junk Repositories on Windows:

Method 1: Clean Temp Files Manually via Command Prompt (CMD)

If you prefer using native command-line scripts without downloading third-party tools, you can purge both user and system temp folders with elevated administrator permissions.

Step 1: Open Elevated Command Prompt

Press Win + S, type cmd, right-click Command Prompt, and select Run as Administrator.

Step 2: Purge User Temp Files

Run the following command to recursively force-delete files and empty subdirectories:

del /q /f /s "%TEMP%\*"
for /d %p in ("%TEMP%\*") do rmdir /s /q "%p"

Step 3: Purge System Temp Files

Next, clean the Windows root temp folder:

del /q /f /s "C:\Windows\Temp\*"
for /d %p in ("C:\Windows\Temp\*") do rmdir /s /q "%p"

Step 4: Purge Windows Update Cache

To safely delete the SoftwareDistribution download cache, you must temporarily stop the Windows Update service:

net stop wuauserv
del /q /f /s "C:\Windows\SoftwareDistribution\Download\*"
net start wuauserv

Why Manual Deletion Causes "File In Use" Errors

When you attempt to select all files and press delete inside %TEMP%, Windows almost always interrupts the process with an annoying modal dialog:

"The action can't be completed because the file is open in another program."

This happens because active background services (like Google Chrome, Microsoft Edge, Slack, or antivirus scanners) maintain an active Win32 file lock on their current session temporary database. If you force-close these programs without saving, you risk losing unsaved data.

⚡ The 1-Click Solution: Pexoris Temp Cleaner
Skip command line scripts and locked-file warnings. Pexoris Temp Cleaner is a free, 56 KB portable utility that automatically calculates recoverable space, protects locked in-use files, and purges all 8 junk repositories in seconds.
Get Pexoris Temp Cleaner (Free Portable) →

Method 2: Clean Temp Files Using Windows Storage Sense

Windows 11 includes an automated cleanup feature called Storage Sense:

  1. Open Settings (Win + I).
  2. Navigate to System > Storage.
  3. Click on Temporary files. Windows will calculate the size of Downloads, Delivery Optimization, and Recycle Bin.
  4. Check the categories you want to purge and click Remove files.

Note: Storage Sense often misses deep crash dumps, WER telemetry queues, and Windows Update payload remnants. For a deep, byte-precise purge, a dedicated portable tool is recommended.

Summary Checklist for Maximum Storage Health