I have folders with these names:

  • Introduction
  • Theoretical Background
  • Methods
  • Results
  • Conclusion

and would like to keep this sequence.

Unfortunately, Windows 7 doesn't let me and orders the folders according to their names or alteration date.

How can I fix the sequence of folders in Windows 7 and 10 according to my requirements?

Is it maybe possible to set an additional folder attribute like "1" or "2" and let Windows sort according to this attribute?

  • 1
    You want to observe this sequence in what context? In Explorer? Something else? Directory order is ultimately a property of display, not of the filesystem (though one can leverage various properties at the filesystem layer to manifest various orderings) Sep 20, 2019 at 13:21
  • I would like to oberserve this sequence in the file explorer.
    – Daniel
    Sep 20, 2019 at 23:21

8 Answers 8


I generally do this by simply prefixing the folders with either letters or numbers, as though they were sections of a document:

1 - Introduction
2 - Theoretical Background
3 - Methods
4 - Results
5 - Conclusions

If there are more than ten "sections", I will use a two-digit zero-padded prefix, e.g., 01, 02, 03, etc.; I've never been quite so deranged as to insist that I need this for a group of over about 15 folders. (Even if I did, I could probably manage to script the rename.)

  • Alphabetic chapter ordinals also work well (A,B,C). Sep 18, 2019 at 15:57
  • I think even Windows 7 is smart enough to sort 2 before 10. Zero-prefixing is not necessary in that case.
    – MSalters
    Sep 19, 2019 at 13:00
  • 3
    Upvoted. Although it tweaks the question a bit, this solution is stable across different file systems, works with backups, and is even portable to other operating systems.
    – Dubu
    Sep 19, 2019 at 13:01
  • 4
    @MSalters - Yes, Windows is smart enough to do so, but occasionally I've gotten anomalous results where it doesn't sort numerics as numerics, so I zero-pad just to prevent that. Sep 19, 2019 at 13:45
  • 1
    As for why you may see this vary, numeric sorting of this type is a feature of Explorer - only in Windows XP and later - and is optional, enabled by default. Other applications presenting file lists may choose their own sorting methods. "Open/Save File" dialogs utilizing the shell sort the same way, though.
    – Corrodias
    Sep 19, 2019 at 18:57

You can make the folders a system folder with a desktop.ini file.

Create a new text file within the folder, and set the content


Where InfoTip=1 sets the "tag" as "1", so you can sort numerically

Then rename the file to desktop.ini.

Then set the folder as a system folder using command prompt

attrib +s "Introduction"

Then in the root folder:

View → Choose Details → add "Comments"

And sort by Comments, now the folders will be sorted according to the "InfoTip" field in the ini file as long as the folder is marked as a system folder.

  • Nice. Setting the read-only attribute on the folder also works. Quickest way to create desktop.ini & set the folder attributes is to assign a custom icon via the Properties dialog. Then edit the desktop.ini file it creates. Sep 19, 2019 at 4:00
  • 2
    +1 because you taught me something, but it looks too much of a hassle. I prefer the solution suggested by @JeffZeitlin.
    – dr_
    Sep 20, 2019 at 7:16
  • @dr01 it actually is not too much hassle, you can just copy and edit the ini file, and you can attrib * to all contents of a directory in one go, a dozen directories take about a minute Sep 20, 2019 at 14:20
  • 1
    +1 because this answer doesn't alter paths. Answers based on renaming will break anything that expects (relies on) certain names/paths. If this happens, fixing may be a real hassle; and if you ever need to change the order then you may need to fix again. In these circumstances this answer may lead to less hassle in total. Sep 21, 2019 at 9:50
  • This solution, while interesting and useful, assumes and requires that 'show hidden and system files and folders' be set, which may not be considered desirable. Sep 25, 2019 at 11:10

Update per comments: doesn't have to be a minute apart, only creation order matters.

If you create them at least a minute apart in the order you want, you can then sort by Date Created. enter image description here

  • 2
    I like that. Nice workaround. Sep 18, 2019 at 14:20
  • 8
    The drawbacks with this method (other than waiting a minute between creating each folder) are that Date created isn't shown by default, and it would be very difficult to insert an additional folder between two existing ones. I'd go with Jeff's suggestion of numbering the folders. If you need them without numbers, copy to new folders (in order, a minute apart) at the very end (renaming doesn't seem to change either the modified- or created- times).
    – TripeHound
    Sep 18, 2019 at 15:26
  • 2
    If you copy a folder structure, it will not preserve the creation date.
    – Boann
    Sep 19, 2019 at 2:51
  • 3
    "Minute apart" does not matter. Actual creation time in the for system is precise to the second regardless of what you see in explorer.
    – n0rd
    Sep 19, 2019 at 14:19
  • @n0rd: When I was testing for my response, it seemed like it mattered, even though I thought it shouldn't, knowing the nature of the value. But it seemed like it matttered at the time. I test now & indeed, as one would expect, the comparison uses the intermal precision, not display percision. Sep 21, 2019 at 0:22

I know this is an old question, but I saw Jan Doggen's answer and wanted to help anyone that may want to use his method, but can't because Windows deletes trailing spaces. Also, I have FINALLY signed up for SE! lol, I come here like 100 times a week.

Instead of using a space, you can use this 'invisible' Unicode character --->‎ <--- (within the arrows). The cool thing about it is that programs will not delete this character whether it precedes or follows a filename, title, header, etc. Well, every program I have used it in hasn't anyways (OneNote, Excel, Windows Explorer, and so on). For example, you can have a product folder with 4 files custom sorted this way (imagine the dashes are spaces - coincidentally, SuperUser is the first website/program I have encountered that treats the invisible character as a space, haha):

---Product Overview

I'm really OCD though, so I think I am going to go with Richie Frame's answer, but still, this will appease most normal folks! Hope it helps :D

P.S. - Huge props to this website for teaching me about it! And if you don't have Unicode shortcuts enabled on your PC, just bookmark that site and you can easily access it through your browser whenever you need it. :)


A variation on Jeff's answer (also interferes little with default Windows behavior and is quickly accomplished): add 4,3,2,1 and 0 spaces in front of the directory names:

   Theoretical Background

A matter of taste ;-)

  • Explorer in Windows 8 deletes leading/trailing whitespace, and I'm pretty sure Windows 7 and 10 do to.
    – wjandrea
    Sep 20, 2019 at 20:50
  • 1
    @wjandrea Indeed (tested Win10). I never work from Explorer (always Total Commander) so I did not notice.
    – Jan Doggen
    Sep 20, 2019 at 21:43

One thing is a real (physical) order of files / directories, the other is their logical order (sorted by name, by extension, ...) shown in File Managers.

Use such a file manager (instead of Widnows Explorer) who is able to show files in their physical order (i.e. unsorted). For example Total Commander:

enter image description here

  • 10
    There is no guarantee that the physical order will be the order that the user wants. This also requires installing third-party software, which may or may not be an option for the querent. Sep 18, 2019 at 16:40
  • That is file-system dependent, and won't work on NTFS for example, see e.g. this.
    – dxiv
    Sep 19, 2019 at 20:38
  • @dxiv, interesting. Thanks!
    – MarianD
    Sep 19, 2019 at 21:33
  • 1
    Some file managers, like Directory Opus, can do manual sorting and saves the order.
    – emptyother
    Sep 20, 2019 at 7:42

First of all, thank you so much for your responses to my question!

I presented them to my colleagues and now half of them are using Jeff's and the other half Richie's solution.

Jeff's solution is, as pointed out by @Dubu, stable across different file systems, works with backups and is portable to other operating systems. Moreover, the solution is fast and easy to accomblish for everyone.

Now, let's assume you are using LaTeX for writing your thesis, then you will use similiar lines of code to insert your sections:


Let's also assume that you make the decision to add a new section, which should come between two existing sections (here between 03 and 04). Which changes are needed to add the new section in the sequence of folders? Using Jeff's solution, you need to rename all existing folders and adjust all paths in your LaTeX file accordingly:


Here, Richie's solution comes in handy. In fact, you do not need numbers in front of folder names anymore. If you make the decision to add a new section, which should come between two existing sections, you just need to update the desktop.ini files. Any adjustments in the LaTeX file, besides inserting the new section, is not needed.


To sum up, it is a personal decision to use Jeff's or Richie's solution. Both of them are great.


An alternative to the link mentioned by TrustKibou is this blanktext website which contains a lot of Unicode whitespace characters. Hope it helps :)

  • 1
    Welcome to SuperUser! Please do not post link only answers, instead quote the most important parts from the linked site as it might change in the future, rendering your answer useless. Jul 22, 2022 at 10:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .