User Tools

Site Tools


microsoft_windows:cleantemp

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
microsoft_windows:cleantemp [2022/05/07 21:34] rodolicomicrosoft_windows:cleantemp [2022/11/14 03:15] (current) rodolico
Line 24: Line 24:
 # Finally, Mozilla Firefox's cache # Finally, Mozilla Firefox's cache
 "Mozilla Cache {0:N2} GB" -f ((Get-ChildItem -force -recurse "C:\Users\*\AppData\Local\Mozilla\Firefox\Profiles\*\cache2" | measure length -s).sum / 1Gb) "Mozilla Cache {0:N2} GB" -f ((Get-ChildItem -force -recurse "C:\Users\*\AppData\Local\Mozilla\Firefox\Profiles\*\cache2" | measure length -s).sum / 1Gb)
 +</code>
  
-######### Do not blindly paste the following lines in. Make sure you know what will happen #########+Do not blindly paste the following lines in. Make sure you know what will happen
 +The following actually does the deletion. However, the -WhatIf says "show me what you'd do", so you must remove //-WhatIf// that before it will actually clean up.
  
-# the following actually does the deletionHowever, the -WhatIf says "show me what you'd do", so +Note, we are only removing files which were created over 30 days ago
-# you must remove that before it will actually clean up.+ 
 +<code powershell>
 Get-ChildItem –Path  “C:\Windows\Temp” –Recurse | Where-Object{$_.CreationTime –lt (Get-Date).AddDays(-30)} | Remove-Item -WhatIf Get-ChildItem –Path  “C:\Windows\Temp” –Recurse | Where-Object{$_.CreationTime –lt (Get-Date).AddDays(-30)} | Remove-Item -WhatIf
 Get-ChildItem -Path "C:\Users\*\AppData\Local\Temp" -Recurse | Remove-Item -Recurse -WhatIf Get-ChildItem -Path "C:\Users\*\AppData\Local\Temp" -Recurse | Remove-Item -Recurse -WhatIf
microsoft_windows/cleantemp.1651977274.txt.gz · Last modified: 2022/05/07 21:34 by rodolico