B.EXE directory lister for OS/2 and DOS Version 1.2 March 25,1995 Dohn Arms Copyright 1995 Dohn Arms Permission to use, copy and distribute this software and its documentation for any purpose and without charging more than a nominal fee for copying is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. This software is provided "as is" without express or implied warranty. This program is "freeware" which means that you do not have to pay for it. It is not public domain, which means that I own the program and no one is allowed to alter the program before redistributing it. The only thing that I ask of anybody that actually uses my program is that if they have access to E-mail, that they send me a message telling me if my program is particularly useful or not. I just want to see that people actually use this. My E-mail address is: dohnarms@uiuc.edu . What is this program? This is a command line program that is to be used to view the contents of a directory. This program is designed to be an alternative for DIR. It has most of the functionality of DIR, except recursive directory searching, and compression information. The reason I wrote the program was since I disliked DIR and I wanted an easy way to view the information contained in a directory. Like DIR, you can also set default switches in an environment variable. What's with the name? The name was simply a convenience for me due to the fact that I like one letter names for programs that I use a lot. I already had programs named C, D, and E, so I named it B. If you don't like this (which I would probably think true), rename it to whatever you like. The program is written with renaming it in mind. The help text (seen with /? switch) will reflect the new name, as will the environment variable. The only condition is that you must keep the .EXE extension in the new name (there are ways to run EXE programs after dropping the .EXE extensions). So change B.EXE to BDIR.EXE if you like, and look at the help screen. The environment variable would then be BDIR, also. Description: When run with no switches, you will see all the files and subdirectories in a directory. The uppercase brown names are the subdirectories. The gray names are files that do not have an extension that is being searched for. Anything of another color is a file of a searched-for extension; the colors are yellow, light green, red, cyan, light cyan, and dark green (these are the official names for these colors). By default, the extensions for OS/2 are EXE, COM, CMD, INF, TXT, and ZIP. For DOS, they are EXE, COM, BAT, DOC, TXT, and ZIP. If there is an asterisk next to a subdirectory or a file, that means that the file or subdirectory is hidden (from normal view, anyway) or is a system file or both. If the name of a file is uppercase, that means the file is either read-only or is a system file or both (if the file is composed of characters with no cases (such as numbers), you won't be able to tell). Under the listing of files and subdirectories, the directory being shown is displayed. Under that is the total number of files shown, with the total size of the files. Also, to the side of this is the total number of subdirectories shown. If all the files can't fit onto the screen, the scrolling stops when the maximum number per screen has scrolled by. If you don't want to see any more of the files, you can stop the scrolling by merely pressing the Escape key ("Esc"). All the files that were visible remain visible on the screen. In the wide view (/W), you will only see file names. In the default normal view (/N), there will be a size in bytes next to each file, and a "" next to each subdirectory. In the date-time view (/D), there will be the time and date of the last write of each file and directory. If you are using one of the previous views and if a file or subdirectory name is longer than 13 characters, in the OS/2 version of B, there will be a ">>" character at the end showing that the file name has been cut off. In the long view (/L), the complete file name is shown, along with file attributes and time up to a half-second. Using the sort switch (/O), you can change how the files and directories are sorted. The files and directories are always grouped apart under each type of sort. You can choose to not sort (/OU). There is the default sort by name (/ON), sort by extension (/OE), sort by size (/OS), and sort by time (/OT). Using the last three switches, if files have the same extension, size, or time, they will be sub-sorted according to name. You can specify a reverse sort for any of them (except /OU) by adding a negative sign after the switch (such as /ON- for a reverse name sort). If you do not wish to see the subdirectories in a directory, using the file-only switch (/K) will remove all subdirectories. If you do not want to see the files, using the subdirectory-only switch (/S) will show only subdirectories. If you want to see the total sizes of subdirectory trees and the total size of the current directory tree, using the total size switch (/Z) will have the "" next to each subdirectory replaced with its size in kilobytes (1 K = 1024 bytes). Also, at the bottom, the total directory size will be displayed. If you wished to see the free space on the disk where the directory viewed is, use the free-space switch (/F) and the information will appear at the bottom, along with the total space on the disk. If you want to see what the extensions being highlighted actually are, use the extension viewing switch (/E), and they will appear in their respective colors at the bottom of the screen. Most people will probably want to change the default extensions to suit their needs. The extension changing switch (/C) will allow this. You can supply a list of up to twelve extensions, each having up to three letters. To do this, simply space out each extension after the /C switch. For example, the default OS/2 extensions would be added like this: "/C COM EXE CMD INF TXT ZIP". The colors taken by the extensions for the first six are unique, then the next six extensions take those same colors over again; extension one and seven have the same color, etc. You can also use a comma as a placeholder if you want to skip over an extension spot in order to keep colors the same, for example adding DOC as an extension with the same color as TXT: "/C COM EXE CMD INF TXT ZIP , , , , DOC"; however this shows up with the /E switch, and you can always avoid this by using the switch that changes the default colors. Some people might want to change the colors. To do this, there is a switch to alter the color scheme (/A). You need to specify nine colors: 1) the color of any text seen, 2) the color of subdirectories, 3) the color of unhighlighted files, 4) the color of extension one, ... and 9) the color of extension six. The colors have a number equivalent, which can be explicitly seen if you use the /? Switch, and are the colors from the old CGA monitor: 0 = black 1 = blue 2 = green 3 = cyan 4 = red 5 = magenta 6 = brown 7 = light gray 8 = dark gray 9 = light blue 10 = light green 11 = light cyan 12 = light red 13 = light magenta 14 = yellow 15 = white To use these, string them together with commas after the /A switch. For instance, the default colors would look like "/A15,6,7,10,14,12,3,11,2". If you use the environment variable to set default switches (described later), and if you want to override switches /K, /S, /F, /Z, and /E, using them a second time will toggle them off. So if you have it defined to show the free space every time with /F, you can turn it off on the command line by using /F again. If you like a certain set of switches to be used by default, you can put them into the environment variable. To do this, the command looks like "SET B=(switches)". You can do this from the command line, or you can put it in your CONFIG.SYS (for OS/2) or AUTOEXEC.BAT (for DOS). An example would look like "SET B=/C C ZIP DOC TXT EXE CMD H /F /OD-". NOTE: If you changed the name of B to something else, the environment variable will also be changed from B. If you renamed B.EXE to BDIR.EXE, the variable would be BDIR. Form of Command: B.EXE [path][wildcard] [/?] [/W|/N|/D|/L] [/K|/S] [/F] [/Z] [/O[-]] [/E] [/C [ext 1] [ext 2] ... [ext 12]] [/Ac1,c2,c3,c4,c5,c6,c7,c8,c9] /? The help screen /W Wide view (uses five columns with only file names) /N Normal view (uses three columns and adds file sizes) /D Detail view (uses two columns and adds dates and times) /L Long view (uses one column and adds long names and attributes) /K Files only (cuts out subdirectories) /S Subdirectories only (cuts out files) /F Shows free space on a disk /Z Shows sizes of subdirectory trees and total size of directory tree /O% Changes sort order, '-' at the end does a reverse sort % = N : name S : size E : extension D : date U : unsorted /E Shows the extensions being used to highlight files /C Change highlighting extensions (1-3 letters for 1-12 extensions) /A(colors) Alter color scheme, where the nine color order is: text, directories, unhighlighted files, extension 1, extension 2, extension 3, extension 4, extension 5, and extension 6. The colors are: 0 = black 1 = blue 2 = green 3 = cyan 4 = red 5 = magenta 6 = brown 7 = light gray 8 = dark gray 9 = light blue 10 = light green 11 = light cyan 12 = light red 13 = light magenta 14 = yellow 15 = white To set default switches: "SET B=(command line arguments)" Contacting the Author: If you have any comments about my program, feel free to E-mail me or write me. I actually want to hear from you if you actually use this, so I know my work in putting this on the Internet has not been in vain. I hope you find this useful. E-Mail: dohnarms@uiuc.edu Mail: Dohn Arms Loomis Laboratory of Physics 1110 West Green Street Urbana, IL 61801-3080