Last active
January 14, 2020 04:32
-
-
Save AzimsTech/3123ad08e5224df413703707553a2f0a to your computer and use it in GitHub Desktop.
Pin Quick Access shortcuts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.NAME | |
Set-QuickAccessShortcut | |
.SYNOPSIS | |
Pin special folders to Quick Acess navigation pane. | |
.DESCRIPTION | |
Folder list: Users, Music, Pictures, Desktop, Documents, Videos, Downloads & Recycle Bin | |
#> | |
# To list all special folders: | |
# [Enum]::GetNames('System.Environment+SpecialFolder') | |
$o = new-object -com shell.application | |
$Users = [Environment]::GetFolderPath([System.Environment+SpecialFolder]::UserProfile) | |
$Music = [Environment]::GetFolderPath([System.Environment+SpecialFolder]::MyMusic) | |
$Pictures = [Environment]::GetFolderPath([System.Environment+SpecialFolder]::MyPictures) | |
$Desktop = [Environment]::GetFolderPath([System.Environment+SpecialFolder]::Desktop) | |
$Documents = [Environment]::GetFolderPath([System.Environment+SpecialFolder]::MyDocuments) | |
$Videos = [Environment]::GetFolderPath([System.Environment+SpecialFolder]::MyVideos) | |
$Downloads = (New-Object -ComObject Shell.Application).NameSpace('shell:Downloads').Self.Path | |
$RecycleBin = 'c:\$RECYCLE.BIN' | |
$PinLists = @($Users, $Desktop, $Documents, $Downloads, $Music, $Pictures, $Videos, $RecycleBin) | |
foreach($PinList in $PinLists) { | |
New-Item -ItemType Directory -Force -Path "$PinList" | Out-Null | |
$o.Namespace($PinList).Self.InvokeVerb("pintohome") | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment