powershell 清理Internet Explorer浏览器历史记录,缓存和下载。来自http://www.fixitscripts.com/problems/a-script-to-clear

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了powershell 清理Internet Explorer浏览器历史记录,缓存和下载。来自http://www.fixitscripts.com/problems/a-script-to-clear相关的知识,希望对你有一定的参考价值。


$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"
}

以上是关于powershell 清理Internet Explorer浏览器历史记录,缓存和下载。来自http://www.fixitscripts.com/problems/a-script-to-clear的主要内容,如果未能解决你的问题,请参考以下文章

powershell PowerShell:Symantec Management Platform Internet Explorer自定义清单

powershell 清理Imsim安装(Windows)

powershell UT3重复配置文件清理

powershell 在SysPrep之前清理图像

powershell 文件夹清理

powershell 清理bin调试文件夹