When Windows 11 Settings or Disk Cleanup cannot remove temporary files, identify which category is locked or in use and use built-in cleanup tools safely.
Quick answer
Start by identifying which layer is failing
What to do first
Some temporary files belong to a running app, update, installer, or system service. A category can also be reported before cleanup finishes. Start with the least disruptive test that can separate a local problem from a wider Windows, network, printer, storage, or hardware issue.
Likely causes
What commonly produces this symptom
Common possibilities include files in use; pending Windows Update; permission or component-store issue; Storage Sense timing; damaged temporary path. The symptom alone does not prove which one is responsible, so use the decision path before changing several things at once.
Diagnostic path
Use evidence before the bigger fixes
Close apps and restart first. Open Settings > System > Storage > Temporary files and read the category names instead of selecting everything blindly. Run Disk Cleanup and choose Clean up system files when appropriate. If Windows Update is pending, let it finish before judging the result.
Record the exact message, when it began, and any update, driver, peripheral, or network change that preceded it.
Test the smallest comparison that applies: another device, account, cable, port, display, printer queue, or power source.
Make one reversible change, restart or retest, and note whether the symptom changes.
Fixes
Work from safest to most invasive
Use Storage Sense; run Disk Cleanup as administrator; stop only a recognized service when Microsoft guidance calls for it; run SFC and DISM for broader corruption; clear a specific user temp directory only through normal permissions and only when no related installer is running; never delete random Windows folders.
Use commands only when they match the evidence. An elevated Terminal may run sfc /scannow to check protected Windows files, followed by DISM /Online /Cleanup-Image /RestoreHealth when component repair is justified. Restart and test after the repair.
When to stop
Know when the next step is support
If cleanup produces access errors, update failures, or a component-store problem, preserve the error and seek administrator or Microsoft support. Avoid random registry edits, unknown driver tools, manual deletion of system folders, or a Windows reset simply because the first check did not work.