Classic Computer Magazine Archive COMPUTE! ISSUE 136 / DECEMBER 1991 / PAGE 72

Made to order. (Microsoft MS-DOS 5.0 Upgrade as a gift)(column) (Evaluation)
by Tony Roberts

For ten years now, I've had computers around the house during the holiday season. For each of those ten years, I've expected a holiday gift of something computer related. Either the members of my family can't believe I'd want something as practical as a computer program for Christmas, or they have no idea what an appropriate computer gift would be.

If you're in the same boat, this year can be different. If you haven't already upgraded to MS-DOS 5.0, start dropping hints now. It's an easy purchase even for someone with no computer knowledge. If you still need help, clip the following paragraph and leave it where it will be noticed.

Microsoft's MS-DOS 5.0 Upgrade is the perfect gift for anyone with a DOS-based computer. DOS is a program that allows a computer to run other programs, and MS-DOS 5.0 is the best version of DOS available. If you're wondering what to buy your computer-loving friend, the answer is simple--an MS-DOS 5.0 upgrade. It's the gift your friend would buy for him- or herself.

Once you have DOS 5.0 installed, take a moment to study the new options for the DIR command. If you don't feel like dragging out the manual, just enter HELP DIR at the command line to see a screenful of information about DIR and its new switches.

In addition to the /P and /W switches that have been around for years, DIR now includes /A to display files with specific attributes, /O to specify a sort order for your directories, /L to provide lowercase output, /B to provide bare output (filenames only), and /S to include subdirectories of the current directory.

Of these, the /S switch is the most intriguing, since it provides a quick files find utility. For example, say you've forgotten where you stored a certain test file you created recently. Try the command DIR TEST*.* /S, and you'll see every file on your hand disk that begins with the letters TEST.

I use this syntax regularly to locate files pertaining to a specific client. When creating the files, I reserve the first two letters of a filename for a client code, usually the initials of the client's business. For example, the letters EM signify a business called Envirosense Management. The command DIR EM*.* /S shows me all the files relating to that business, including correspondence files in my word processing directory, page layout files in the PageMaker directory, and even invoice records in my accounting subdirectory.

The /O switch lets me order subdirectories in various ways. Normally, /ON is most useful to me for sorting the directory by name. Often, though, I want a good look at the most recently created files, so I sort by date, as in DIR /OD. To reverse the normal sort order, use a minus sign in the command. DIR /OS orders a directory by size with the largest files listed first. Use this command when you're short of disk space and want to determine which files occupy the most real estate.

In addition to permitting sorting by date, size, name, or extension, this command also includes an option to list subdirectories first, which results in a cleaner, easier-to-read directory listing. DIR /OGN creates a directory sorted by name with the directories listed ahead of the filenames.

You can display files with various attributes by using the /A switch. When executed from the root directory, DIR /AH /S will display the hidden files on the entire disk. As you can see from this command, it's permissible to combine more than one switch in the same line.

Another new and handy switch is /B. This provides a listing of filenames only and can be combined with other switches. This command is useful when combines with DOS redirection to create a file that contains a list of selected files. DIR *.TXT /ON /B > FILELIST.DOC builds a directory of all the TXT files in the current subdirectory sorted by name. That directory is then stored in a file called FILELIST.DOC, which you can edit.

The best thing about these switches and options is that you don't have to remember how to use them. You can teach DOS which directory style you prefer. Then whenever you type DIR, you'll get a directory with all the switches and options you want.

This is accomplished through DIRCMD, an environment variable. My preferred settings are /L /OGN, which provide a lowercase listing sorted by name with subdirectories first. To make this my default directory, I included the command SET DIRCMD=/L /OGN in my AUTOEXEC.BAT file.

Whenever I use the DIR command, I get the information I want presented the way I want to see it. If I need different information for a specific case, I just specify it with the usual switches, and the command line switches override the default switches. You can even reverse the effect of the default lowercase switch by including a /-L on the command line.

The improved DIR command is one very basic way MS-DOS 5.0 makes computing easier. As many times as I use that command, it's nice finally to have it my way.