ConfigMgr Console

Customize Quick Access

Topics: ConfigMgr Console

Modify Windows Explorer Quick Access Items

This post is part of a Windows Customizations series.

I’ll provide a couple of examples, both adding items to the quick access and removing items.

Demo Image

Typical Quick Access area, with Folder defaults:
Quick Access 01

After running the Add / Remove scripts:
Quick Access 02

Deployment Methods

This is just a few lines of PowerShell code, but the catch is that it needs to be run in the User Context. To do that, I’m deploying it as a Configuration Item in a Baseline.

Code

Adding Folders

This code is pretty straight forward, connect to the shell com object, then “pin” the folders.

$QuickAccess = New-Object -ComObject shell.application
$Folders = @("srcsrc
quot;,"C:WindowsCCMLogs") foreach ($Folder in $Folders) { $QuickAccess.Namespace($Folder).Self.InvokeVerb("pintohome") } 

Remove Folders

This is similar, but with a couple of nuances. Music & Videos folders require different “verb” to remove (removefromhome), vs other folders (unpinfromhome).

To keep it simple, I run both verbs against each object. If the folder you want to remove doesn’t exist, you will get an error, which is why the code below checks for the folder in the quick access items first.

$Namespace = "shell:::{679f85cb-0220-4080-b29b-5540cc05aab6}"
$QuickAccess = New-Object -ComObject shell.application
$RecentFiles = $QuickAccess.Namespace($Namespace).Items()
$Folders = @("Videos", "Music", "Pictures")
foreach ($Folder in $Folders)
    {
    $SelectFolder = $RecentFiles | Where-Object {$_.Path -match $Folder}
    if ($SelectFolder){
        $SelectFolder.InvokeVerb("unpinfromhome")
        $SelectFolder.InvokeVerb("removefromhome")
        }
    }

To grab the full scripts used in baseline, you can grab them from GitHub.

Customize Quick Access Summary

That’s it, simple concept, simple to add to your task sequence, and super handy.


Series Table of Contents


About Recast Software

1 in 3 organizations using Microsoft Configuration Manager rely on Right Click Tools to surface vulnerabilities and remediate quicker than ever before.

References

Back to Top