Windows Explorer - Search - Layout keeps resetting to Icons

0

Every time I use the search function in Windows Explorer (Ctrl+E) it ignores my global setting to use the Details view (unless I explicitly set it already for the folder I'm searching in the past).

How can this be configured without using an AutoHotKey script or third-party software? I strongly prefer the Details layout (and running AHK scripts gets me kicked from games that use AntiCheat).

enter image description here

A super frequent use case for me when I use the search function is to sort by Date Modified, but you cannot see that in Icon view.

I'm using Windows Server 2016 right now, but it's the same thing on my Windows 10 computers.

Also refer to this dead-end Techspot thread

Elaskanator

Posted 2019-06-27T16:41:55.543

Reputation: 177

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 to HKCU, 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.747

If 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

Answers

1

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: Documents.SearchReuslts TopView 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

Keith Miller

Posted 2019-06-27T16:41:55.543

Reputation: 1 789