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.

Packet Capture with PowerShell
Deprecating TLS 1.0 and TLS 1.1
Create Local Administrator Account Remotely

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