Our school library PCs are getting really slow these days, students can barely browse for their project research. We are looking for options to clear some trash and improve device performance; any help?
Clear temp files on windowsSolved
2568 Views
Tags
Replies (4)
The script repo has scripts to clear temp files and browser cache:
These should improve your performance significantly, otherwise I would suggest a complete wipe and reinstall, they will be good as new!
Definitely that would be an option, do we have resources to clear cache from other browsers, I can only see Google Chrome here?
Hey @Valerie,
Found this script online, worked fine for me; maybe you could try it out:
PowerShell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
$cleanupTypeSelection = 'Temporary Sync Files', 'Downloaded Program Files', 'Memory Dump Files', 'Recycle Bin' foreach ($keyName in $cleanupTypeSelection) { $newItemParams = @{ Path = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$keyName" Name = 'StateFlags0001' Value = 1 PropertyType = 'DWord' ErrorAction = 'SilentlyContinue' } New-ItemProperty @newItemParams | Out-Null } Start-Process -FilePath CleanMgr.exe -ArgumentList '/sagerun:1' -NoNewWindow -Wait Write-Host -ForegroundColor Green "Getting the list of users" md c:\install -force dir C:\Users | select Name | Export-Csv -Path C:\install\users.csv -NoTypeInformation $list=Test-Path C:\install\users.csv Write-Host -ForegroundColor Green "SECTION 1: Clearing some other stuff" Import-CSV -Path C:\install\users.csv -Header Name | foreach { Remove-item C:\Users\$($_.Name)\AppData\Local\Microsoft\Outlook\*.nst -Force -EA SilentlyContinue -Verbose Remove-item C:\Users\$($_.Name)\appdata\Local\Microsoft\Windows\Explorer\*.db -Force -EA SilentlyContinue -Verbose Remove-Item -path "C:\Users\$($_.Name)\AppData\Local\Microsoft\Teams\previous\*" -Recurse -Force -EA SilentlyContinue -Verbose } Write-Host -ForegroundColor Green "SECTION 2: Clearing Mozilla Firefox Caches" Import-CSV -Path C:\install\users.csv -Header Name | foreach { Remove-Item -path C:\Users\$($_.Name)\AppData\Local\Mozilla\Firefox\Profiles\*.default\cache\* -Recurse -Force -EA SilentlyContinue -Verbose Remove-Item -path C:\Users\$($_.Name)\AppData\Local\Mozilla\Firefox\Profiles\*.default\cache\*.* -Recurse -Force -EA SilentlyContinue -Verbose Remove-Item -path C:\Users\$($_.Name)\AppData\Local\Mozilla\Firefox\Profiles\*.default\cache2\entries\*.* -Recurse -Force -EA SilentlyContinue -Verbose Remove-Item -path C:\Users\$($_.Name)\AppData\Local\Mozilla\Firefox\Profiles\*.default\thumbnails\* -Recurse -Force -EA SilentlyContinue -Verbose Remove-Item -path C:\Users\$($_.Name)\AppData\Local\Mozilla\Firefox\Profiles\*.default\cookies.sqlite -Recurse -Force -EA SilentlyContinue -Verbose Remove-Item -path C:\Users\$($_.Name)\AppData\Local\Mozilla\Firefox\Profiles\*.default\webappsstore.sqlite -Recurse -Force -EA SilentlyContinue -Verbose Remove-Item -path C:\Users\$($_.Name)\AppData\Local\Mozilla\Firefox\Profiles\*.default\chromeappsstore.sqlite -Recurse -Force -EA SilentlyContinue -Verbose Remove-item C:\Users\$($_.Name)\AppData\Local\Mozilla\Firefox\Profiles\*\Cache2\* -Recurse -Force -EA SilentlyContinue -Verbose } Write-Host -ForegroundColor Green "SECTION 3: Clearing Google Chrome Caches" Import-CSV -Path C:\install\users.csv -Header Name | foreach { Remove-Item -path "C:\Users\$($_.Name)\AppData\Local\Google\Chrome\User Data\Default\Cache\*" -Recurse -Force -EA SilentlyContinue -Verbose Remove-Item -path "C:\Users\$($_.Name)\AppData\Local\Google\Chrome\User Data\Default\Cache2\entries\*" -Recurse -Force -EA SilentlyContinue -Verbose Remove-Item -path "C:\Users\$($_.Name)\AppData\Local\Google\Chrome\User Data\Default\Cookies" -Recurse -Force -EA SilentlyContinue -Verbose Remove-Item -path "C:\Users\$($_.Name)\AppData\Local\Google\Chrome\User Data\Default\Media Cache" -Recurse -Force -EA SilentlyContinue -Verbose Remove-Item -path "C:\Users\$($_.Name)\AppData\Local\Google\Chrome\User Data\Default\Cookies-Journal" -Recurse -Force -EA SilentlyContinue -Verbose Remove-Item -path "C:\Users\$($_.Name)\AppData\Local\Google\Chrome\User Data\Default\Service Worker\CacheStorage\*" -Recurse -Force -EA SilentlyContinue -Verbose } Write-Host -ForegroundColor Green "SECTION 4: Clearing Internet Explorer Caches" Import-CSV -Path C:\install\users.csv | foreach { Remove-Item -path "C:\Users\$($_.Name)\AppData\Local\Microsoft\Windows\Temporary Internet Files\*" -Recurse -Force -EA SilentlyContinue -Verbose Remove-Item -path "C:\Users\$($_.Name)\AppData\Local\Microsoft\Windows\WER\*" -Recurse -Force -EA SilentlyContinue -Verbose Remove-Item -path "C:\Users\$($_.Name)\AppData\Local\Microsoft\Windows\inetcache\*" -Recurse -Force -EA SilentlyContinue -Verbose Remove-Item -path "C:\Users\$($_.Name)\AppData\Local\Temp\*" -Recurse -Force -EA SilentlyContinue -Verbose Remove-Item -path "C:\Users\$($_.Name)\AppData\Local\Microsoft\Windows\webcache\*" -Recurse -Force -EA SilentlyContinue -Verbose Remove-Item -path "C:\Windows\Temp\*" -Recurse -Force -EA SilentlyContinue -Verbose Remove-Item -path "C:$recycle.bin\" -Recurse -Force -EA SilentlyContinue -Verbose Remove-Item -path "C:\Users\$($_.Name)\AppData\Local\Microsoft\Edge\User Data\Default\Cache\*" -Recurse -Force -EA SilentlyContinue -Verbose Remove-Item -path "C:\Users\$($_.Name)\AppData\Local\Microsoft\Edge\User Data\Default\Code Cache\*" -Recurse -Force -EA SilentlyContinue -Verbose Remove-Item -path "C:\Users\$($_.Name)\AppData\Local\Microsoft\Edge\User Data\Default\Service Worker\CacheStorage\*" -Recurse -Force -EA SilentlyContinue -Verbose } |
Just ping me if you need help
It works great! Thank you for that…
Save