Like the title says: I am not able to change the default sorting option in windows explorer. At the moment folders and files are sorted by date modified, but I'd like to change this to sorted by name. I followed the answer in Having Windows 7 "Sort by File Type" by default (adapted to sort by name). But after closing windows explorer and opening it again, all files and folders are sorted by date modified.

How can I change the default sorting option?

  • 1
    Did you click on Apply to Folders in the Folder Options > View tab?
    – Karan
    Jun 19, 2015 at 7:56
  • Of course I did. Although in my German windows 7 version the button is called Für Ordner übernehmen, I think I've pressed the correct button. ;-)
    – wewa
    Jun 19, 2015 at 8:07
  • I followed each step you mentioned, but your proposed solution does not work for me.
    – wewa
    Jun 19, 2015 at 8:14
  • Thank you, I only need to execute this batch file. Afterwards sorting option is sorted by name. The steps mentioned above would be necessary if I'd like to set another sorting option than sorted by name to default sorting. Could you please write an answer with this solution, so that I can mark it as working solution.
    – wewa
    Jun 19, 2015 at 10:32

1 Answer 1


Reset all folder view settings to the default using the following batch file:

@echo off

:: To reset all folders to default folder views
Reg Delete "HKCU\Software\Microsoft\Windows\Shell\BagMRU" /F
Reg Delete "HKCU\Software\Microsoft\Windows\Shell\Bags" /F
Reg Delete "HKCU\Software\Microsoft\Windows\ShellNoRoam\Bags" /F
Reg Delete "HKCU\Software\Microsoft\Windows\ShellNoRoam\BagMRU" /F
Reg Delete "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\BagMRU" /F
Reg Delete "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags" /F
Reg Delete "HKCU\Software\Classes\Wow6432Node\Local Settings\Software\Microsoft\Windows\Shell\Bags" /F
Reg Delete "HKCU\Software\Classes\Wow6432Node\Local Settings\Software\Microsoft\Windows\Shell\BagMRU" /F

:: To reset Windows Photo Viewer position
Reg Delete "HKCU\Software\Microsoft\Windows Photo Viewer\Viewer" /VA /F

:: To kill and restart explorer
taskkill /f /im explorer.exe
start explorer.exe

Afterwards if required you can specify the folder template via folder Properties > Customize tab, then change the sort order and Apply to Folders from the Folder Options > View tab.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.