Windows sort by date

Sort files by date with folders on top

I’m not sure if this is possible in Windows 10, but when I had Windows 7 I could do it.

I want the layout to be a list, sorted by date with the folders on top, so it should look like this:

— Folder 1 (most recent)

— File 1 (most recent)

I had it like this when I had Windows 7 but now with Windows 10 when I tried to make it look like this I only get:

— File 1 (most recent)

— Folder 1 (most recent)

which is very annoying to me since I have tons of files and I have to get to the end to see the most recent folder.

I know it can be made using the details layout but I really don’t like that one.

I hope someone can help me.

Option 1: Sort by «Date» column, instead of «Date Modified». If «Date» is missing, add it by right-clicking column header and click More.

Option 2: Sort by «Date Modified» and then do a secondary sort by Name holding the SHIFT key.

[Source] How to sort by most recent with folders on top? — Microsoft Community: http://answers.microsoft.com/en-us/windows/forum/windows_7-files/how-to-sort-by-most-recent-with-folders-on-top/78ac9fc6-0fce-4533-8075-88ebc77bcd29

This behavior is the same in Windows 7 as well.

56 people found this reply helpful

Was this reply helpful?

Sorry this didn’t help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How to sort by date in filename?

I have a bunch of meeting minutes, where the filename is the date the meeting took place. I would like to sort by this date.

The dates in my case are of the following form: 01.01.2009.doc 30.12.1999.doc 6.05.2010.doc ..

Some files are also of the following form: AD 01.01.2009.doc KT2 05.05.2000.doc .

How can I do this? Is it even possible?

4 Answers 4

If the files were created on set dates you can just sort them by date in explorer. I’m guessing this is not the case. So if you rename files as Molly suggested (yyyy-mm-dd) then sorting by name will also sort them by date.

Читайте также:  P2055d driver windows 10

Since you already have a bunch of such files instead of renaming them one by one, I suggest you use Total commander, which has built in multi-rename tool. This tool enables you to easily rename files to this format. Just rename each batch of files that have same type of name after another.

To rename for example files named dd-mm-yyyy to yyyy-mm-dd:

  • select files you want to rename (using either r-mouse click or space)
  • press ctrl+M or select menu Files -> Multi rename tool
  • press Range button and select year part, press ok
  • repeat for month and day and put — in between, you should end up with [N7-10]-[N4-5]-[N1-2]
  • press Start button (bottom of the form) to run the renaming process
  • repeat the process for other groups with similar names

How to sort by date modified ascending ALWAYS in Windows?

How to force Windows to sort always by date modified and always ascending?

The situation is that often

1) Modified field is Off (not listed in Sort By menu by default)

2) Once opened More menu modified field is sometimes named Modified and some times Date modified

3) Once selected, it switched to Descending .

So, in most circumstances I need more than 10 click to do this sorting.

How to make zero?

2 Answers 2

Instructions

Press + E to open File Explorer, and then click onto the root of the «C» drive

If the Date modified doesn’t show here for some reason, then simply right click on one of the other existing columns and then select the Date modified option there to show the column.

Now press Alt + V , Y , O to bring up the Folder Options window and then go to the View tab from there. Select the Apply to Folders option, and then select the Yes option on the pop up window that asks if you want to apply this view to all folders.

An Important Gotcha: It seems that each disk partition on the machine which has a folder where video files or picture files exist (i.e. MP4, JPG, etc.), you have to manually do steps #2 — #5 on one of these folders on each disk partition before these folder view settings become effective with other folders on the same disk partitions with similar files types. It seems Windows 10 automatically recognizes folders with video and/or picture files, and it optimizes the view for these file types otherwise. Once you complete this on one of these folders containing such files on each disk partition, the view settings seem to stick and become effective for others.

Now check various folders and you should notice the files and folders are sorted in the order by the fields and in the view as you set per the above instructions.

Читайте также:  Ultraiso для windows 10 как создать образ

Windows ‘dir’ command: sort files by date when ‘/s’ is specified

Goal: I want to copy the latest file with a certain extension from a «source directory» to a «destination directory» using a batch file. The latest file may be under several sub-directories within the source directory.

This question/answer is exactly what I want, however it does not seem to sort when the /s option is specified (as this comment would suggest):

You can test DIR «K:\path\tp\source\dir\*.ext» /B /S /O:D by itself to see that it does not sort.

What I’ve Tried: This command by itself does work: DIR «K:\path\tp\source\dir\*.ext» /S /B | sort but I can’t figure out how to use it in a for loop (batch file exits before I can determine the error — even with a pause at the end).

3 Answers 3

You can call out to Powershell from you batch file if you want to. This code can be shortened on newer versions of Powershell .

A simple solution could be

This code uses robocopy to generate the list of files with a timestamp prefix (the switches just request no job header, no job summary, no file class, no file size, timestamp, recursive, no directory list, no directory information copy, include same files, no retry, no wait, don’t copy only generate list).

This timestamp prefixed list (UTF yyyy/mm/dd hh:mm:ss last file write) is then sorted in reverse order to get the last file in the first line. This line is retrieved with a separate cmd instance (this avoids a time problem with a for /f reading long lists of data) so the for /f only reads one line.

Читайте также:  Линукс для установки вместо андроид

As the robocopy lines contain the date, time and file name, to retrieve this last field, we request the for /f to retrieve two tokens: one containing the hour (will be stored in %%a ) and the remaining text until the end of the line (stored in %%b )

The additional for %%r is included just to prevent a usual problem using robocopy . As we are quoting paths to prevent problems with spaces, we need to ensure the paths do not end with a backslash that will escape the path’s closing quote and make the command fail.

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

I can sort files and directories in Windows Explorer by date modified . I always let recent files display first. But when I sort by date modified, directories are always displayed after the files.

Is it possible to sort files by date modified, but display directories before files?

8 Answers 8

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.

Оцените статью