Clear Your Temp Folder with One PowerShell Command

Empty %TEMP% safely from PowerShell to reclaim disk space and clear stale installer caches.

Windowsdisk-cleanupcleanuppowershellHigh risk
Run `Remove-Item "$env:TEMP\*" -Recurse -Force -ErrorAction SilentlyContinue` to empty your user temp folder.

01Command

Command
$ Remove-Item "$env:TEMP\*" -Recurse -Force -ErrorAction SilentlyContinue

02What it does

The per-user TEMP folder accumulates installers, logs, and crash dumps that quietly eat gigabytes. SilentlyContinue keeps the command from stopping on files that are locked by running programs — those are simply skipped and can be cleared next time. Repeat the same pattern for C:\Windows\Temp with an admin prompt if needed.

03Risk

RiskHigh risk
RequirementsWindows PowerShell; no admin rights for the per-user TEMP folder.
!Warning: Don't run this while an installer is mid-way through an update; wait until it finishes.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

Last verified: 2026-09-19 · Category: System & Settings

06Related solutions