Script to make the desktop Internet Explorer default in Windows 8 (PowerShell)

Introduction

This PowerShell script shows how to make the Desktop Internet Explorer default in Windows 8.

Scenarios

By default, when you click on a web link in the Windows 8, Internet Explorer will open that web page in the Windows 8 version of IE (non-desktop Internet Explorer).  But some users want to make the Desktop Internet Explorer default when they open a web link anywhere.

Script

Step1: Start the PowerShell Console with administrator. To run the script in the Windows PowerShell Console, type the one command< Script Path> at the Windows PowerShell Console.
For example, type C:\Script\SetDesktopIE.ps1
The step is shown in the following figure
When the script finishes running, Windows PowerShell Console displays brief information about the script.
 
Now, we can find the Internet Explorer is already set as “Always in Internet Explorer on the desktop”
 
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.
PowerShell
Edit|Remove
Switch ($IEModeValue)  
{ 
    0{ 
        Set-ItemProperty-Path $KeyPath-Name "AssociationActivationMode"-Value 2 |Out-Null 
        Write-Host "Set the desktop Internet Explorer mode default successfully."-ForegroundColor Green 
        break 
    } 
     
    1{ 
        Set-ItemProperty-Path $KeyPath-Name "AssociationActivationMode"-Value 2 |Out-Null 
        Write-Host "Set the desktop Internet Explorer mode default successfully."-ForegroundColor Green 
        break 
    } 
     
    2{ 
        Write-Warning"You have already been set the desktop Internet Explorer mode."break 
    } 
}

Prerequisite

Windows PowerShell 2.0
Windows 8