Don’t you just hate it when your favorite files get lost in a large directory? If you don’t like opening Windows Explorer and having to scroll endlessly until you find your essential files, directories, and shortcuts, here’s how you can force your favorites to the top of the tree, where they won’t get lost among the branches.
How Windows sorts directories
To understand why this tip works, you need to know how Windows sorts file names. Sorting is based on characters’ ASCII values. OSs are so transparent nowadays that you may not have heard this word for some time. ASCII (pronounced ASK-ee) stands for American Standard Code for Information Interchange. Originally, this standard described how all PCs interpreted keyboard characters. Now, ASCII is a subset of extended standards, such as Unicode, which include international characters and symbols. Years ago, however, the 128-character ASCII standard was enough.
ASCII assigns each keyboard character a value. For instance, the numbers 0-9 use the (decimal) values 48-57, and the uppercase letters A-Z use the values 65-90. In a sorted list of file names, numbers appear before letters because their ASCII values are lower—a clever decision on the part of the standards writers. Many keyboard symbols have values that are even lower than numbers. For instance, a look at a standard ASCII chart shows that the exclamation point has a value of 33.
Get the point?
Since characters with lower values always appear first on a sorted list, all you have to do to force your favorites to display at the top is to add an exclamation point in front of the file name. For example, I have a directory called Myarticles, which I access often. By renaming it !myarticles, I assure that its folder icon always appears at the top of the My Documents stack, as shown in Figure A.
|Files with an exclamation point as the first character appear first.|
Basically, when you name files in this manner, you’re creating mini-directories without having to navigate additional folders. As you can see in Figure B, I’ve grouped together a bunch of template files that I use for writing. This tip works for all folder entries—in Outlook, Windows Explorer, and other applications.
|Using a special character lets you group files together at the top of directories.|
Although I used an exclamation point in my examples, you can use any of the following characters for this trick: (!) (#) ($) (%) (‘) (+) (,) or (.). Some of the characters with values from 33 to 47 are among those reserved by Windows for special functions, such as redirects, pipes, or wildcards; you can’t use them. Illegal characters for file names include the following: (/) (\) (:) (*) (?) (”) (<) (>) and (|). Figure C lists the characters with ASCII values from 33 to 47.
|These characters have ASCII values from 33 to 47.|
Caution for UNIX and Linux users
If you’re going to move files between Windows and Linux or UNIX, you have to be careful with this trick. For example, in these OSs, a “dot” file (one that starts with a period) is a hidden file. Any of your files that begin with a period (.) will disappear from the directory. A plus sign (+) also creates problems. You’ll want to check the list of reserved characters in Linux and UNIX before you use this tip. You can always play it safe by using a zero in front of the name.
Bonus tip: The [Alt] key trick
Thanks to ASCII, there’s also a quick way to type special characters directly from the keyboard. If you find yourself starting charmap or trying to remember how to enter symbols into Word or WordPerfect, here’s how to chuck all that hassle. Do you have an employee who’s French and who uses an accented è? That character is 138 in ASCII. With Numlock on, hold down the [Alt] key and type 138 on the keypad. Voilà! (For the à in Voilà, use [ALT] 133.)
Mike Jackman is an editor in chief of TechProGuild, an editor of PC Troubleshooter and Windows Support Professional, and also works as a freelance Web designer and consultant. In his spare time (when he can find some), Mike’s an avid devourer and writer of science fiction, parent to two perpetually adolescent cats, and a hiking enthusiast.
The authors and editors have taken care in preparation of the content contained herein, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for any damages. Always have a verified backup before making any changes.
Subscribe to the Developer Insider Newsletter
From the hottest programming languages to commentary on the Linux OS, get the developer and open source news and tips you need to know. Delivered Tuesdays and Thursdays