Script to remove Internet Explorer in Windows 7 (VBScript)

Introduction

This VBScript demo shows how to remove Internet Explorer in Windows 7.

Scenarios

In some situations, customers need to uninstall Internet Explorer 9 to fix crash issue, but they cannot manually uninstall Internet Explorer successfully sometimes.

Script

Step 1: Double-click RemoveInternetExplorer.vbs to run this VBScript sample. The step is shown in the following figure. 

When script finishes running, you will see something as shown in the following figure.

 

Here are some code snippets for your references. To get the complete script sample, please click the download button at the beginning of this page.

VB Script
Edit|Remove
If Flag > 0Then 
    resultRemoveIE = MsgBox("Are you sure you want to remove Internet Explorer. This process might take a long time, so please be patient.",vbYesNo+vbQuestion,"Remove the Internet Explorer") 
    If resultRemoveIE = 6ThenSet objExecObject = objShell.Exec("Dism /online /Disable-Feature /FeatureName:Internet-Explorer-Optional-amd64")     
        While objExecObject.Status = 0 
            WScript.Sleep 1WendCall ChoicePromt 
    EndIfElse 
    resultRemoveIE = MsgBox("Internet Explorer is already disabled, do you want to enable the Internet Explorer? This process might take a long time, so please be patient.",vbYesNo+vbQuestion,"Enable the Internet Explorer") 
    If resultRemoveIE = 6ThenSet objExecObject = objShell.Exec("Dism /online /Enable-Feature /FeatureName:Internet-Explorer-Optional-amd64") 
        While objExecObject.Status = 0 
            WScript.Sleep 1WendCall ChoicePromt 
    EndIfEndIf

Prerequisite

Windows 7