Created
April 17, 2014 19:26
-
-
Save iqwirty/11006341 to your computer and use it in GitHub Desktop.
First iteration of a script to help find / rid various stuff left on a Windows computer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Clear-Host | |
$outputFile = "c:\tempo\cleaner-$(Get-Date -Format yyyy-MM-dd_hh-mm-ss).log" | |
$pathsToClean = @("$Env:USERPROFILE\AppData\Roaming\Microsoft\Word", ` | |
"$Env:USERPROFILE\AppData\Roaming\Microsoft\Excel", ` | |
"$Env:USERPROFILE\AppData\Roaming\Microsoft\PowerPoint", ` | |
"$Env:USERPROFILE\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.Word", ` | |
"$Env:USERPROFILE\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.MSO", ` | |
"$Env:USERPROFILE\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.Outlook", ` | |
"$Env:USERPROFILE\AppData\Local\Microsoft\Office\UnsavedFiles", ` | |
"$Env:TEMP", ` | |
"c:\temp", ` | |
"$Env:USERPROFILE\AppData\Local\Temp", ` | |
"c:\windows\temp", ` | |
"$Env:USERPROFILE\Downloads" | |
) | |
ForEach ($p in $pathsToClean) ` | |
{ | |
"$p : $((dir -Path "$p" -Recurse | Measure-Object).Count)" | Out-File -FilePath $outputFile -Append | |
dir -Path $p -Recurse | Select FullName | Out-File -FilePath $outputFile -Append | |
} | |
Invoke-Item $outputFile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment