Skip to content

Instantly share code, notes, and snippets.

@farhad0085
Last active February 28, 2025 06:50
Show Gist options
  • Save farhad0085/2e9899553e96bf97f827fa5d1d9e0614 to your computer and use it in GitHub Desktop.
Save farhad0085/2e9899553e96bf97f827fa5d1d9e0614 to your computer and use it in GitHub Desktop.
Disable default Sorting and Groupby in windows explorer

Run the following in powershell.

# This script will remove grouping from all possible views of the Downloads folder. 
# The change is applied to the current user's profile only. 
# Warning: ALL folder views (except Downloads grouping) will revert to Windows defaults! 
# This is a minimal solution. To set ALL default folder views, use the free tool WinSetView. 
 
$RegExe = "$env:SystemRoot\System32\Reg.exe" 
$File = "$env:Temp\Temp.reg" 
$Key = 'HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{885a186e-a440-4ada-812b-db871b942259}' 
& $RegExe Export $Key $File /y 
$Data = Get-Content $File 
$Data = $Data -Replace 'HKEY_LOCAL_MACHINE', 'HKEY_CURRENT_USER' 
$Data = $Data -Replace '"GroupBy"="System.DateModified"', '"GroupBy"=""' 
$Data = $Data -Replace '"SortByList"="prop:System.DateModified"', '"SortByList"="prop:System.Name"' 
$Data | Out-File $File 
& $RegExe Import $File 
$Key = 'HKCU\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\Shell' 
& $RegExe Delete "$Key\BagMRU" /f 
& $RegExe Delete "$Key\Bags" /f 
Stop-Process -Force -ErrorAction SilentlyContinue -ProcessName Explorer

OP: https://answers.microsoft.com/en-us/windows/forum/all/completely-disable-file-grouping-always-everywhere/ac31a227-f585-4b0a-ab2e-a557828eaec5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment