Skip to content

Instantly share code, notes, and snippets.

@hl2guide
Created May 6, 2026 16:26
Show Gist options
  • Select an option

  • Save hl2guide/3aca0466f05f2b9462b95ccf041d8b5f to your computer and use it in GitHub Desktop.

Select an option

Save hl2guide/3aca0466f05f2b9462b95ccf041d8b5f to your computer and use it in GitHub Desktop.
Clears temp files in Windows 11. Close all running apps before running it.
# Clears the Windows temp folder (current)
$TempFolder = "$env:TEMP"
Remove-Item -Path "$TempFolder\*" -Recurse -Force `
-ErrorAction SilentlyContinue
Write-Host
Write-Host "Cleared temp folders in: $env:TEMP" -ForegroundColor Cyan
Write-Host
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment