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 the quick access is not a folder and I don't know how to read what is inside. Can someone help me?
CodePudding user response:
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()