Cleanup Windows

Cleanup Windows

There are several temp folders that Windows uses to store "temporary" files, that being said, Windows is not very good at keeping its house in order.

Sophos Cleanup Script
Deprecating TLS 1.0 and TLS 1.1
RoboCopy Excel List of Directories

There are several temp folders that Windows uses to store “temporary” files, that being said, Windows is not very good at keeping its house in order. So this two line script can be used to do just that!

# Cleans C:\Windows\Temp
# Cleans C:\Windows\Prefetch
# Cleans C:\Documents and Settings\*\Local Settings\Temp
# Cleans C:\Users\*\Appdata\Local\Temp
$tempfolders = @("C:\Windows\Temp\*", "C:\Windows\Prefetch\*", "C:\Documents and Settings\*\Local Settings\temp\*", "C:\Users\*\Appdata\Local\Temp\*"
Remove-Item $tempfolders -force -recurse
 

COMMENTS