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.

Testing SSL and TLS with PowerShell
RoboCopy Excel List of Directories
Security Incident Response and Data Acquisition

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