Last active
October 1, 2017 17:36
-
-
Save jhorsman/74b95217f195cd5f3fae to your computer and use it in GitHub Desktop.
Clean Internet Explorer browser history, cache and downloads. From http://www.fixitscripts.com/problems/a-script-to-clear-browsing-history-download-history-and-empty-the-cache-for-ie-chrome-firefox
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
$t_path_7 = "C:\Users\$env:username\AppData\Local\Microsoft\Windows\Temporary Internet Files" | |
$c_path_7 = "C:\Users\$env:username\AppData\Local\Microsoft\Windows\Caches" | |
$d_path_7 = "C:\Users\$env:username\Downloads" | |
$temporary_path = Test-Path $t_path_7 | |
$check_cashe = Test-Path $c_path_7 | |
$check_download = Test-Path $d_path_7 | |
if($temporary_path -eq $True -And $check_cashe -eq $True -And $check_download -eq $True) | |
{ | |
echo "Clean history" | |
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1 | |
echo "Clean Temporary internet files" | |
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8 | |
(Remove-Item $t_path_7\* -Force -Recurse) 2> $null | |
RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2 | |
echo "Clean Cache" | |
(Remove-Item $c_path_7\* -Force -Recurse) 2> $null | |
echo "Clean Downloads" | |
(Remove-Item $d_path_7\* -Force -Recurse) 2> $null | |
echo "Done" | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment