如何使用脚本重置 Internet Explorer 的设置?

如何使用脚本重置 Internet Explorer 的设置?

我想使用批处理文件将 Internet Explorer 重置为出厂默认设置。我还想删除:所有下载、历史记录、Cookie 和缓存,以及用户 IE 配置文件中的任何其他内容。

答案1

有一个 Powershell 脚本可以执行此操作。不过,您需要根据自己的环境/需求对其进行调整。目前,它需要人工交互。它位于这篇超级用户帖子& 由 创建阿曼·达利

#+-------------------------------------------------------------------+   
#| = : = : = : = : = : = : = : = : = : = : = : = : = : = : = : = : = |   
#|{>/-------------------------------------------------------------\<}|            
#|: | Author:  Aman Dhally                                        | :|            
#| :| Email:   [email protected] 
#|: | Purpose: Reset Internet Explorer Setting to Default   
#| :|       
#|: |  more info: http://newdelhipowershellusergroup.blogspot.in/                                                           
#| :|           
#|: |                 Date: 23 - July - 2012 
#|: |                            16:29 
#| :|     /^(o.o)^\    Version: 1                                    |: |  
#|{>\-------------------------------------------------------------/<}| 
#| = : = : = : = : = : = : = : = : = : = : = : = : = : = : = : = : = | 
#+-------------------------------------------------------------------+ 


## Load Assembly ## 
[void][reflection.assembly]::Load("System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089") 
#-  

"`n" 
Write-Host  "  ============================================" -ForegroundColor 'Green' 
Write-Host  "   [ Resetting IE To Default Settings]" -ForegroundColor 'Red'  
Write-Host  "  ============================================" -ForegroundColor 'Green' 
"`n" 
###  
"`n" 

$arrOfficeProcs = "iexplore" 
$continue = $false 
cls 

#Check for open Office apps 
do { 
    $arrRunning = @() 

    foreach ($proc in $arrofficeProcs) { 
        if(((get-process $proc -ea SilentlyContinue) -ne $Null)){ $arrRunning += $proc }        
    } 

    if ($arrRunning.length -gt 0 ) {   
        $d = [System.Windows.Forms.MessageBox]::Show( 
        "There are currently one or more Internet Explorer windows Open.`n`nYou must close down all Internet explorer windows before reset it to default.",  
        "Reset IE Settings to Default...",  
        [System.Windows.Forms.MessageBoxButtons]::RetryCancel,  
        [System.Windows.Forms.MessageBoxIcon]::Warning ) 

        if ($d -eq [Windows.Forms.DialogResult]::Cancel) { exit } 

    } else {  
        $continue = $true 
        write-host "  No IE process are currently running"  -ForegroundColor 'Green' 
        "`n" 
        Write-Host "  Please TICK on `"Delete personal Settings`" and then click on `"Reset`" button   <====" -ForegroundColor 'Yellow'  
        "`n" 
        & RunDll32.exe InetCpl.cpl,ResetIEtoDefaults | Out-Null 
        "`n" 
        Write-Host "  ====> Please Launch Internet Explorer Now" -ForegroundColor 'Magenta'  


"`n" 
Write-Host  "  ============================================" -ForegroundColor 'Green' 
Write-Host  "   [ Resetting Done]" -ForegroundColor 'Red'  
Write-Host  "  ============================================" -ForegroundColor 'Green' 
"`n" 


    } 


} while ( $continue -eq $false ) 


#### End of the Script #### A m a n     D h a l l y ---- [email protected]

答案2

要自动重置 Internet Explorer,请按照以下步骤操作:

注意:此 Microsoft Fix it 支持 Windows 7、Windows Vista 和 Windows XP。

  1. 下载:http://go.microsoft.com/?linkid=9646978

  2. 在文件下载对话框中,单击运行,然后按照向导中的步骤进行操作。

  3. 在“重置 Internet Explorer 设置”对话框中,单击“重置”。

    如果您还想删除浏览历史记录、搜索提供程序、加速器、主页、跟踪保护和 ActiveX 筛选数据,请单击选中“删除个人设置”复选框。

  4. 当 Internet Explorer 应用完默认设置后,单击“关闭”,然后再次单击“关闭”。

  5. 关闭然后启动 Internet Explorer。

相关内容