Clear Your Temp Folder with One PowerShell Command
Empty %TEMP% safely from PowerShell to reclaim disk space and clear stale installer caches.
01Command
$ Remove-Item "$env:TEMP\*" -Recurse -Force -ErrorAction SilentlyContinue02What 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
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- Remove-Item (Microsoft.PowerShell.Management)Evidence: Documents -Recurse to delete folders with children, -Force for hidden/readonly items, and -ErrorAction SilentlyContinue behavior.
- Remove-Item — Delete files and foldersEvidence: Shows Remove-Item with -Recurse and -Force used to delete directory trees.
Last verified: 2026-09-19 · Category: System & Settings
06Related solutions
Search inside text files and logs with regex, returning file, line number and match.
Create or update a .zip from any files or folder contents straight from PowerShell.
A built-in PowerShell one-liner that answers 'is port 5432/3389/443 actually open through this network?' — no telnet client needed.