Change Windows Explorer’s (in taskbar) Starting Location (PowerShell)

Introduction

The script shows how to change Windows Explorer’s (in taskbar) Starting Location in Windows 8.

Scenarios

When you start 'Windows Explorer (in taskbar)',it will navigate to 'Library' by default. However, sometimes people want it to navigate folder or 'Computer’. This script can achieve that. And i think it will be more convenient if set 'Windows Explorer' starting with folder often used.

Script

This script contains one advanced functions Set-OSCExploreStartLocation, 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
$FileLink = "$Env:USERPROFILE\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\File Explorer.lnk"#Create wscript.shell$shell = New-Object-ComObject WScript.Shell 
#Create shortcut$shortcutX = $shell.CreateShortcut($FileLink#Set shortcut targetpath and argument

Examples

Example 1: Set 'My Document' as File Explorer’s (Taskbar) starting location.
Command: Set-OSCExploreStartLocation -MyComputer
Screenshot:

Example 2: Set 'C:\Users' as File Explorer’s (Taskbar) starting location.
Command: Set-OSCExploreStartLocation -TargetPath C:\Users
Screenshot:

Example 3: Set "My document" as File Explorer’s(Taskbar) starting location by using CLSID.
Command: Set-OSCExploreStartLocation -TargetPath  "%SystemRoot%\explorer.exe" -Argument "/n,::{450D8FBA-AD25-11D0-98A8-0800361B1103}"
Screenshot:

Note  You can set "library" and "My Document" as starting location by using similar command in Example 1.

Prerequisite

Windows 8