Eliah Gerber
Eliah Gerber

Reputation: 13

How to get the Quick Access Paths

I want to write all paths stored in quick access to a text file. With a normal folder this would not be a problem. But "quick access" is not a folder and I don't know how to read what is inside.

Upvotes: 0

Views: 226

Answers (1)

Theo
Theo

Reputation: 61148

You can use COM for this:

$shell = New-Object -ComObject Shell.Application 
$paths = $shell.Namespace("shell:::{679f85cb-0220-4080-b29b-5540cc05aab6}").Items() | ForEach-Object { $_.Path }

# view on screen
$paths

# write to text file
$paths | Set-Content -Path 'X:\MyQuickAccessPaths.txt'

# don't forget to remove the used COM object from memory when done
$null = [System.Runtime.Interopservices.Marshal]::ReleaseComObject($shell)
[System.GC]::Collect()
[System.GC]::WaitForPendingFinalizers()

Upvotes: 1

Related Questions