Permanently Changing Column Width in Windows Explorer Search

Page 1 of 2 12 LastLast

  1. Posts : 5
    Windows 10
       #1

    Permanently Changing Column Width in Windows Explorer Search


    Hello,

    I'm a long time dweller and first time poster. I've recently run into an issue where my windows 10 doesn't seem to remember my default column width after each search. In other words, each time I open This PC icon, and type in the upper right hand corner to do a search of a file, the column widths will default back to the normal size as opposed to the default size I want. Is there a way to change it permanently so that my searches always show the default column width and column types I want? I can't seem to figure it out and any help would be helpful! Thanks so much.
      My Computer


  2. Posts : 565
    Windows 10 Professional 64-bit
       #2

    Have you tried dragging the left hand edge of the search box to the left to increase the width of the search box?

    If I do this on my PC the search box width then stays at the width that I dragged it to.
      My Computers


  3. Posts : 5
    Windows 10
    Thread Starter
       #3

    wiganken said:
    Have you tried dragging the left hand edge of the search box to the left to increase the width of the search box?

    If I do this on my PC the search box width then stays at the width that I dragged it to.
    Thanks for your response. I do that manually each time i search but if you close the window for that particular search and reopen another search then the columns go back to their default width. I am looking for a solution so that the width is the same size each time I open a new search. Do you know a work around for that?
      My Computer


  4. Posts : 16,587
    Windows 10 Home x64 Version 22H2 Build 19045.4046
       #4

    The solution is not trivial. See KeithM's post in
    Customize File Explorer Search Default Columns - TenForums

    Denis
      My Computer


  5. Posts : 5
    Windows 10
    Thread Starter
       #5

    Try3 said:
    The solution is not trivial. See KeithM's post in
    Customize File Explorer Search Default Columns - TenForums

    Denis
    Thank you. This is a little embarrassing but I have no idea what they're talking about on the forums. I've tried to access the registry but cannot find the subdirectory to change the values to what I want. I previously fixed this issue with a someone's premade registry file that you simply clicked on and it'll adjust the columns but I can't seem to find that file or forum thread anymore.

    I'm just wondering how microsoft sucks so much donkey balls to make a product so user unfriendly compared to their previous iteration. I wish the programs I used wasn't so dependent on the windows ecosystem so I can migrate to another OS.
      My Computer


  6. Posts : 16,587
    Windows 10 Home x64 Version 22H2 Build 19045.4046
       #6

    I also thought the solution was not straightforward [adjusting search results columns is nowhere near as simple as adjusting other File explorer folder views]. I made lots of notes from the linked post and the other posts to which it refers but, other than a quick partial test run, I have not found/made the time to study the subject thoroughly enough to be able to do the job.

    You could try asking KeithM by putting
    @
    in front of his user name. Perhaps he has posted the procedure somewhere in a single consolidated post that I have not spotted.

    In my notes, I also kept a link to How to Customize Default Search Views on Windows 10 - Appuals but I don't know if it is better or just different.

    The easy part of the job is getting search results to display than Details view rather than Content view and you've probably done it already - it is a simple one-off Registry change. Change Search Results Default View - Ramesh Srinivasan

    Denis
      My Computer


  7. Posts : 989
    Microsoft Windows 10 Home
       #7

    Hi. Just checked in & saw this thread. Search Result view settings are saved based on the folder the search is initiated from. But all these unique views are rooted in the virtual Desktop. If you don't seem to be sving the views, you're possibly maxed out.

    Can you open a PowerShell window & copy & pste the following code? It will return a number. If that number is 5000, you've maxed out & need to clear all saved views. Run this code to check:
    Code:
    ((gp "HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\BagMRU").Nodeslots).count
    Sample Output:
    Code:
    PS C:\> ((gp "HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\BagMRU").Nodeslots).count
    941
    PS C:\>

    If that number is 5,000, delete all saved views with this PowerShell:

    Code:
    sl 'HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell'
    'BagMRU', 'Bags' | Remove-Item -Recurse
      My Computer


  8. Posts : 5
    Windows 10
    Thread Starter
       #8

    KeithM said:
    Hi. Just checked in & saw this thread. Search Result view settings are saved based on the folder the search is initiated from. But all these unique views are rooted in the virtual Desktop. If you don't seem to be sving the views, you're possibly maxed out.

    Can you open a PowerShell window & copy & pste the following code? It will return a number. If that number is 5000, you've maxed out & need to clear all saved views. Run this code to check:
    Code:
    ((gp "HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\BagMRU").Nodeslots).count
    Sample Output:
    Code:
    PS C:\> ((gp "HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\BagMRU").Nodeslots).count
    941
    PS C:\>

    If that number is 5,000, delete all saved views with this PowerShell:

    Code:
    sl 'HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell'
    'BagMRU', 'Bags' | Remove-Item -Recurse
    Thank you for your response. I did indeed have 5000 counts. However, after deleting all saved views from my Powershell, I reverted to content view as opposed to Details view whenever I do a search via This PC.

    I am still having trouble figuring out how to just get the columns to have name, date modified and folders as well as adjusting the width of these columns so that these settings are saved each time I generate a new search via This PC. I'm not exactly tech savvy so it's really frustrating and any help would be greatly appreciated.

    Best,

    Peter
      My Computer


  9. Posts : 989
    Microsoft Windows 10 Home
       #9

    I'll walk you through it, don't worry. Just one thing at a time. The Content view is the default for most Search Results, so what you're seeing is normal. And you've already had sucess with executing the code I've provided. If you can continue to do that, provide requested feedback, and trust me, we can get you set to your liking.

    There are several different registry tricks to accomplish this, and I think I just though of a mew way to combine some tricks to copy a view you've set as a defalut for Search Results, but I need to play & test.

    For now, please test that once you modify hte Search Results for a given folder, those settings are used on a subsequent search of the same folder after closing & re-opening.


    Just for fun, as you search varous locations, modify the view, and save the view by closing the window, you can verify the accumulation of saved views by running this code. Keep the PowerShell window open an re-execute the command by pressing:
    +Enter


    Code:
    $BagMRU = 'HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\BagMRU'
    $Shell  = New-Object -ComObject shell.application
    (gi $BagMRU).Property -match '\d+' | ForEach{
        Try{
            ( $Shell.NameSpace(( Get-ItemPropertyValue $BagMRU $_ ))).Title
        } Catch {}
    }

    *** Duplicate listing for each location is normal as each saved view for SearchResults and Library folders use two NodeSlots/Bags per view. ***


    Code:
    Quick AccessThis PC
    Search Results in Local Documents
    Search Results in Sandbox
    Search Results in A Chorus Line
    Search Results in Screenshots
    Search Results in Pictures
    One Drive
    Network
    Search Results in BagMRU Decode
    Search Results in BagMRU Decode
    Search Results in Local Pictures
    Search Results in Local Pictures
    Control Panel
    Search Results in Windows (C:)
    Search Results in Windows (C:)
    ...
      My Computer


  10. Posts : 989
    Microsoft Windows 10 Home
       #10

    OK, here's version 1.0 of Set_Saved_Search_View_As_Default. When you run the code, you'll be presented with a GridVIvew control listing your saved SearchResults views, along with the FolderType used. All the common FolderTypes have a corresponding SearchResults type with the exception of Downloads, which uses its base type for search results as well. You have to set a default for each type to override its default. Possible search result types are:

    Downloads
    Contacts.SearchResults
    Documents.SearchResults
    OtherUsers.SearchResults
    Pictures.SearchResults
    Communications.SearchResults
    UsersLibraries.SearchResults
    Music.SearchResults
    Generic.SearchResults
    PublishedItems.SearchResults
    UserFiles.SearchResults
    Videos.SearchResults

    Though it's unlikely most users will ever see all of those. In the GridView, select the folder(s) you want copy as a template for its FolderType. You can only have one template for each type, if you select a type that already has an entry under AllFolders, or if you select more than one of the same type, the last one written will be the one to survie.

    Permanently Changing Column Width in Windows Explorer Search-screenshot-922-.png

    Select the Folders/Types and click OK. PowerShell will display confimation for each view copied:
    Code:
     . . .
    >> '@ -f $Splat )
    >> }
    >>
    Default view set for: Pictures.SearchResults
               Based on: "Search Results in Spring 2015" ( Bag #949 )
               Key Name: HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{4DCAFE13-E6A7-4C28-BE02-CA8C2126280D}



    Copy & paste directly into PowerShell or save as a .ps1 file.

    Code:
    ### String constans
    $ShellKey    = 'HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell'
    $BagMRU      = "$ShellKey\BagMRU"
    $Bags        = "$ShellKey\Bags"
    $ConfirmCopy = @'
    
    Default view set for: {0}
                Based on: "{1}" ( Bag #{2} )
                Key Name: {3}
    
    '@
    
    ### Dictonary FOlderTYpeID -> FolderType.CanonicalName
    $FTKey     = Get-Item 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes'
    $FT_Lookup = $FTKey.GetSubkeyNames() | ForEach{ $hash = @{'{25CC242B-9A7C-4F51-80E0-7A2928FEBE42}'='Network'} } {
         $hash.Add( $_, $FTKey.OpenSubkey($_).GetValue('CanonicalName') )
    } { $hash }
    
    
    $Shell  = New-Object -ComObject shell.application
    (Get-Item $BagMRU).Property -match '\d+' | ForEach{
    Try{
        [PSCustomObject]@{
            'Bag'  = Get-ItemPropertyValue "$BagMRU\$_" NodeSlot
            'Name' = ( $Shell.NameSpace(( Get-ItemPropertyValue $BagMRU $_ ))).Title
        } 
    } Catch {}
    } | Where Name -match 'Search Results' |
        Where { (Test-Path "$Bags\$($_.Bag)\Shell") -and (Get-Item "$Bags\$($_.Bag)\Shell").SubKeyCount } | ForEach{
        $Splat = @{
            'NotePropertyName'  = 'Type'
            'NotePropertyValue' = $FT_Lookup[( Get-Item "$Bags\$($_.Bag)\Shell" ).GetSubkeyNames()]
            'PassThru'          = $True
        }
        $_ | Add-Member @Splat
    } | Group Name | ForEach {
        [PSCustomObject]@{
            'Name'   = $_.Name
            'Bag'    = $_.Group.Bag
            'Type'   = $_.Group.Type | Select -Unique
        }
    
    ### *** Launch GridView for folder selection ***
    
    } | Out-GridView -PassThru | ForEach{
    
    ### Confirm copy
        $Splat = @(
            $_.Type
            $_.Name
            $_.Bag
            ( Copy-Item -Path "$Bags\$($_.Bag)\Shell\*" -Destination "$Bags\AllFolders\Shell" -Recurse -Force -PassThru ).Name.Replace( 'HKEY_CURRENT_USER' , 'HKCU' )
        )
        Write-Output ( $ConfirmCopy -f $Splat )
    
    ### Apply to existing?
        If ( ( Read-Host 'Apply this template to any currenly saved views of the same type? (Y/N)' ) -match '^y') {
            Get-ChildItem $Bags -Recurse -Depth 2 |
              Where PSChildName -eq $Splat[3].Split('\')[-1] |
              Where Name -notMatch AllFolders |
            Remove-Item -Recurse -Force
        }
    }
    Last edited by KeithM; 06 Mar 2021 at 13:39.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 17:10.
Find Us




Windows 10 Forums