Windows 11 Clear Temp — Files !!better!!

echo Cleaning prefetch... del /q /f /s "%SystemRoot%\Prefetch*" > nul 2>&1

Write-Host "Desktop shortcut created!" -ForegroundColor Green function Create-ScheduledTask $taskName = "WindowsTempCleaner" $scriptPath = $MyInvocation.MyCommand.Path windows 11 clear temp files

Register-ScheduledTask -TaskName $taskName -Action $action -Trigger $trigger -Settings $settings -Principal $principal -Force echo Cleaning prefetch

if (Test-Path $shortcutPath) Write-Host "Shortcut already exists on desktop." -ForegroundColor Yellow return windows 11 clear temp files

# 3. Windows Prefetch $prefetch = "$env:SystemRoot\Prefetch" $locations += @Path = $prefetch; Name = "Windows Prefetch"

function Get-RecycleBinSize try $shell = New-Object -ComObject Shell.Application $recycleBin = $shell.NameSpace(0xA) $size = 0 foreach ($item in $recycleBin.Items()) $size += $item.Size