@
KeithM
Many thanks for the explanation! Now that you have confirmed that dialog and folder views are stored in the same Bags ;-) let me give you my wishlist:
- All dialogs and folders show detail view by default; if I need something else, I can change it on the fly. It looks as though your script will do this for me

- I can still customize the columns shown for the dialogs and folder types.
- I can still assign folder types by using „Also apply this template to all subfolders“ on the „Customize“ tab of the folder properties dialog. I would expect this to be automatic, at least for subfolders of the standard media folders or libraries (Music, Pictures, Videos) but apparently it isn‘t.
- Windows *does not* assign any folder types dynamically.
- WIndows *does not* remember changes made to individual folders, only to the folder templates.
This is probably an idle daydream, but as a Bags god, perhaps you can tell me how close I can get to this paradise ;-)
Here I am trying to edit my magnum opus (above
), and you've already replied!
- Should be quite doable. My script would probably do the tricki (haven't given it a good look yet), but I think we can be a lot leaner.
- Within the confines of the existing types, sure.
- "Also apply this template to all subfolders" aka Inheritance. Thereby hangs a tale. You observations are correct, it's a relatively powerless key now, controlling only the FolderType. When it first appeared in XP and was set via the UI, it would control FolderType and icon mode -- the OS created the key with those two values. But one day with RegMon, I saw that if the key existted & had those two values, it was queried by Explorer for the set of view settings: ColumnInfo, Sort, Group -- everything in a normal bag. The functionality had been built in to Explorer but never exposed via the UI. So I wrote a nifty for the time VBS script: FolderViewMaster, and it was quite popular. Alas, that functionality is long gone. The designated folders for a given type under This PC automatically use their correspoinding
FolderType
, so this can be used to override that behavior, or to defeat content-sniffing. The one nifty thing is that it can be added via a reg edit to the root/virtual Desktop. So if you create an Inherit key with FolderType = Generic
to ensure USB drives always display with the Generic
template. But it comes with caveats: if you create it before viewing Quick Access or This PC or Network ( or they lose their saved views ) the Genric template will "break" some of their custom features. - Does it really matter what
FolderType
you're using if they've all cloned the Generic column selection?? ? <j/k> - Maybe....maybe not...
While I'm sleeping, start by using Apply to Folders to set the "common " Foldertypes
: Generic, Documents, Downloads, Generic, Music, Pictures, and Videos. You can verify template creation by looking for the GUID-named values under: HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Defaults
. Or run this PowerShell to display hte type names.
Code:
Function Get-CustomFolderTypes {
$Defaults = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Defaults'
$FT = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes'
If ( ! ( $global:FT_Lookup )) { # Available for interactive use
$sbBegin = {$hash = @{ # for duration of PowerShell session
'{25CC242B-9A7C-4F51-80E0-7A2928FEBE42}' = 'Network'
'{D6D9E004-CD87-442B-9D57-5E0AEB4F6F72}' = 'Recycle Bin'
}}
$global:FT_Lookup = gci $FT | ForEach $sbBegin {
$hash.Add( $_.PSChildName , ($_).GetValue('CanonicalName') )
} { $hash }
@"
FT_Lookup: FolderTYpeID -> FolderType Name created.
Use:
`t"`$FT_Lookup.GetEnumerator() | sort value | ft -AutoSize"
to view in console or type:
`t"`$FT_Lookkup | Out-GridView"
to browse, sort, and filter.
"@ | Write-Host
}
If ( Test-Path $Defaults ) {
(gi $Defaults).Property | ForEach{ [PSCustomObject]@{
'ID' = $_
'Name'= $FT_Lookup[$_]
}}
} Else {
Write-Host "`n`t`tNo Customized Templates`n"
}
}
Set-Alias -Name gcft -Value Get-CustomFolderTypes
gcft
In addition to the "base types", Apply to Folders works for a number of "one-offs" -- types dedicated to a single system folder ( e.g. AccountPictures
& shell:AccountPictures
), as well as "mirrors" of the common types used by OneDrive ( FolderTpes
beginning with StorageProvider
), so you need to hit those as well.
Here's the output of gcft
after hitting all I'm aware of:
Code:
ID Name
-- ----
{B3690E58-E961-423B-B687-386EBFD83239} Pictures
{885A186E-A440-4ADA-812B-DB871B942259} Downloads
{94D6DDCC-4A68-4175-A374-BD584A510B78} Music
{5C4F28B5-F869-4E84-8E60-F11DB97C5CC7} Generic
{5FA96407-7E77-483C-AC93-691D05850DE8} Videos
{7D49D726-3C21-4F05-99AA-FDC2C9474656} Documents
{24CCB8A6-C45A-477D-B940-3382B9225668} HomeFolder
{DD61BD66-70E8-48DD-9655-65C5E1AAC2D1} StorageProviderDocuments
{672ECD7E-AF04-4399-875C-0290845B6247} StorageProviderMusic
{71D642A9-F2B1-42CD-AD92-EB9300C7CC0A} StorageProviderPictures
{51294DA1-D7B1-485B-9E9A-17CFFE33E187} StorageProviderVideos
{4F01EBC5-2385-41F2-A28E-2C5C91FB56E0} StorageProviderGeneric
{D6D9E004-CD87-442B-9D57-5E0AEB4F6F72} Recycle Bin
{0B0BA2E3-405F-415E-A6EE-CAD625207853} Searches
{DE2B70EC-9BF7-4A93-BD3D-243F7881D492} Contacts
{DB2A5D8F-06E6-4007-ABA6-AF877D526EA6} AccountPictures
{2C7BBEC6-C844-4A0A-91FA-CEF6F59CFDA1} Printers
HomeFolder = Quick Access
Once you've created those, you can clear any saved Dialog views that used any of those FolderTypes
. This will ensure they use your custom view:
Code:
$Defaults = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Defaults'
$Bags = 'HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags'
$CustomIDs = ( Get-Item $Defaults ).Property
( Get-ChildItem $Bags -Recurse ) |
Where PSChildName -like ComDlg* |
Where { $_.GetSubkeyNames()[0] -in $CustomIDs } |
Remove-Item -Recurse