opello.{com,net,org}

Windows Downloads Folder Grouping

Wednesday, February 14, 2024 categories: windows

I built a new PC a few years ago using the Intel 8086K that I won in the Intel 40th Anniversary Sweepstakes. It's been a good machine that I've only really used for games. Over the last year or so I've used it for some more hobby projects and I finally got annoyed with the Downloads special folder always opening up with the contents being grouped by date.

I wasn't terribly surprised to find that this was a common thing people complained about. In the Microsoft Community thread I found about the problem the solution was to basically forcibly set all folder view settings. This is a reasonably straight forward answer and what I believe I'd done on my previous Windows installs. After all, details view is the only right answer, right? :) In the Super User question on the topic it seemed that there was a nicer solution that preserved the existing folder view settings. It also required taking ownership of the key from regedit.exe. But then:

> reg query 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{885a186e-a440-4ada-812b-db871b942259}\TopViews\{00000000-0000-0000-0000-000000000000}' /v GroupBy

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{885a186e-a440-4ada-812b-db871b942259}\TopViews\{00000000-0000-0000-0000-000000000000}
    GroupBy    REG_SZ    System.DateModified

> reg add 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{885a186e-a440-4ada-812b-db871b942259}\TopViews\{00000000-0000-0000-0000-000000000000}' /v GroupBy /t REG_SZ /d System.Null /f
The operation completed successfully.

> reg query 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{885a186e-a440-4ada-812b-db871b942259}\TopViews\{00000000-0000-0000-0000-000000000000}' /v GroupBy

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{885a186e-a440-4ada-812b-db871b942259}\TopViews\{00000000-0000-0000-0000-000000000000}
    GroupBy    REG_SZ    System.Null

However, even after restarting explorer.exe my Downloads folder was still showing up grouped.

The solution came from another forum thread on the topic which explained the way view settings for special folders are stored in the registry and presented a PowerShell snippet to remove them for the Downloads special folder:

$Bags = 'HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags'
$DLID = '{885A186E-A440-4ADA-812B-DB871B942259}'
(Get-ChildItem $bags -recurse | ? PSChildName -eq $DLID ) | Remove-Item
gps explorer | spps

This also restarted explorer.exe which may not be a surprise, but I don't use PowerShell enough to know gps is Get-Process and spps is Stop-Process. But finally my Downloads folder was showing up in details view sorted by modified like I wanted!