The main 'ugliness' I was referring to is that if you modify entries under HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes
, you run into permission issues on certain keys. For instance, you can't modify values under {24ccb8a6-c45a-477d-b940-3382b9225668}
, which is the view template for Quick Access. Quick testing shows that you may have no permisssion issues modifying the varous SearchResults templates, as long as you remember to export the key first so you can restore if anything goes wrong.
So, for starters, take a look at all the various view templates with this bit of PowerShell:
$FT = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes'
gci $FT |
select PSChildName,
@{ N = 'Name' ;E = {(gp $_.PSPath).CanonicalName}}
You're only concerned with SearchResults, so we filter the results:
gci $FT |
?{(gp $_.PSPath).CanonicalName -match 'SearchResults'} |
select PSChildName,
@{ N = 'Name' ;E = {(gp $_.PSPath).CanonicalName}}
The specific view settings are in the GUID-named subkeys of the TopViews subkey of each template:
Here, LogicalViewMode is the value you're concerned with. Valid values are:
1 Details
2 TIles
3 Icons
4 List
5 Content
So, to set all the SearchResults to Details view, you would run the following from and Administraitve PowerShell window:
$FT = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes'
gci $FT |
?{(gp $_.PSPath).CanonicalName -match 'SearchResults'} |
%{
$TVkey = gi "$($_.PSPath)\TopViews"
$TVkey.GetSubkeyNames() |
%{$Key2edit = $TVkey.OpenSubkey($_, $True)
$Key2Edit.SetValue('LogicalViewMode', 1)
$Key2Edit.Close()
}
}
Keith
1Do you consider registry modification "hackery"? Search Results don't use the same view template as the folder being searched. But modifcations you have made to the search results for individual folders should be saved. But otherwise, the templates used are found under:
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes
. You can edit these, but that's kind of ugly (permission issues, etc.). A better way is to copy the key toHKCU
, which gives you a per-user copy of these templates which can be modifed with no permission issues and deleted to restore default behavior. – Keith Miller – 2019-06-28T19:20:04.747If you're interested in this approach, I can post more detail & PowerShell scripts that automate the key creation/modification. – Keith Miller – 2019-06-29T19:28:15.560
Instead of "hackery" I should have said "third party tools." Thanks! So essentially you figure out the registry key with the search results template (maybe from a per-folder entry somewhere that you've customized through Explorer normally), then overwrite a global template? Or are you saying there is no registry entry to copy from and that's part of the ugliness, beyond just getting user permissions? – Elaskanator – 2019-06-30T15:28:50.253