Sort files by date modified, but folders always before files in Windows Explorer?

First, put the directory into “Details” view mode (if it isn’t already) so you have column headings.

If you click on the “Date Modified” heading, which will sort by Date Modified (descending), and then Shift+click on “Name”, it should remain sorted by Date Modified (descending), but with the folders at the top.

Note: This is observed as not working while the “preview pane” is enabled (Windows 7).  Simply disable the preview pane temporarily with Alt+P before sorting.  The preview pane can then be re-enabled and the sort method will remain.

To revert this, just click on whatever column you want to sort by.

Once you have the sort order that you want, you can switch into one of the other view modes (e.g., “Icons”, “List” or “Tiles”), and the presentation will retain the sort order that you specified.


Try arranging the files by Date instead of Date Modified. I always have the problem with folders appearing before my files. It seems when you arrange by date, folders are displayed at the top regardless of the direction of arrangement. When you arrange by date modified, folders are always at the bottom in descending order.


I've been trying to do the same (i.e. distinguish the sort for folders from files, leaving files sorted by date). A clunky solution for win7 is suggested to me by another superuser post, making use of the 'group by' capabilities. If the file attributes are displayed in explorer (e.g. view > sort by > more... > [check 'attributes']), then you can group by attribute (essentially files vs. folders) using view > group by > attributes, and sort by date modified using view > sort by > date modified. With this, I can get folders to appear at the top, and files underneath this arranged by date.

Why would I want to do this? I'm by no way pedantic in how I organize files, but I do find I end up with a large directory structure - and typically when clicking through this, I'm usually interested in getting to subfolders. When I've reached the folder I want however, I usually will be wanting to access the most recently modified file. So having folders and recently modified files at the top saves scrolling.