Change Windows Store apps default installation location in Windows 8 (PowerShell)

Introduction

The script shows how to change Windows Store apps default installation location in Windows 8.

Scenarios

The default installation location of Windows Store apps is in drive C. If the drive is full and you want to install large apps, you need to change the default installation location.

Video

Script

This script contains one advanced functions Set-OSCAPPPackageRoot, you can use this script in the following way:

Run Import-Module cmdlet to import this module file.

Import-Module filepath\scriptname.psm1

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
If(Test-Path-LiteralPath 'HKCR:\*\shell\runas') 
{ 
    Set-Location-LiteralPath 'HKCR:\*\shell'Remove-Item-Path ".\runas"-Recurse -Confirm:$false 
} 
If(Test-Path-LiteralPath 'HKCR:\Directory\shell\runas' ) 
{ 
    Set-Location-LiteralPath 'HKCR:\Directory\shell'Remove-Item-Path ".\runas"-Recurse -Confirm:$false  
} 
If(Test-Path-LiteralPath 'HKCR:\dllfile\shell' ) 
{ 
Set-Location-Path 'HKCR:\dllfile\' 
Remove-Item-Path ".\shell"-Recurse -Confirm:$false  
} 
Set-Location (Split-Path$env:ComSpec -Parent) 
Write-Host "Remove 'Take ownership' from context menu successfully."

Examples

Example 1: Change the default installation location to 'E:\File'.
Command: Set-OSCAPPPackageRoot -Path E:\File
Screenshot:

Example 2: Restore the default installation location its original location.
Command: Set-OSCAPPPackageRoot -Restore
Screenshot:

Prerequisite

Windows 8