logo for MegaDots Duxbury Systems, Inc. logo logo for MegaDots

Supplement 1: An Introduction to DOS

Now that most desktop computer operating systems-such as Windows and the Mac OS -- have easy-to-use "point-and-click" graphical user interfaces, fewer people have had experience with text-only systems like DOS. For PC users, however, using DOS still has some advantages. Windows runs older DOS programs very well.

Understanding DOS

Microsoft's MS-DOS (for Disk Operating System) was designed in 1981 for the original IBM PC, and suffers from many of that computer's limitations. MS-DOS is a simple system that let computer users manage files on floppy disks and run programs. MS-DOS made the most of a computer with little memory or processing power.

The DOS command line is a simple and effective, if somewhat arcane, way to interact with the computer. The system prompts the user with a short text string-the familiar C:> or something similar-when it is ready. The user types in a command which DOS performs, either displaying results or running a program. The DOS command line can be frustrating because it requires you to remember the names and formats of a number of commands. Error messages and feedback from DOS are often curt or technical.

Since all commands are specified by name, the first word you type on any command line must be the name of a program or DOS function. Words following the command are file names, options or other parameters for the command. The command TYPE SOME.TXT <Enter> is a simple example. The type command is a DOS function which displays the contents of a file. The parameter SOME.TXT is the name of the file to display. DOS makes no distinction between upper and lower case letters in commands and file names. However, DOS has no tolerance for typos; if you misspell a command it bluntly responds with "Bad command or file name."

DOS supports computers with several disk drives, referring to drives by letter: A, B, C, etc. First two drives, A and B are reserved for floppy disks. Drive C is usually the computer's main hard disk. If you had many files on a disk, searching through a list to find a particular one would be very time consuming. To aid in organization, DOS allows files to be grouped in directories, much like organizing papers in manilla file folders. Unlike, manilla folders, you can put directories inside of other directories to organize further. An outline-like view of this directory structure (omitting the files) might look like:

C: \

Navigation in a DOS System

As in the example above, on your computer's hard disk there will be several directories, some of which may contain further sub-directories. To access a file, DOS must have the full "path" from the drive all the way down through levels of directories to the file. To create a full path, simply string together the directory names, using backslashes to separate them. For example, the path to a file named README.TXT in the business directory would be C:\BUSINESS\README.TXT. Using the full path, the command to display the contents of README.TXT is TYPE C:\BUSINESS\README.TXT <Enter>.

Typing full paths can quickly become tedious, so DOS lets you set a current working directory. The current directory serves as a starting point for names in the drive and directory hierarchy. It is usually shown as part of the prompt, so you always know which drive and directory are current. Changing directories is a simple procedure in DOS; the CD command (for "change directory") will change the current directory to wherever specified. After using the command CD C:\BUSINESS <Enter> to set the current directory, the DOS prompt will display C:\BUSINESS>. From there, the command to display README.TXT is TYPE README.TXT <Enter>, which omits the full path to the file. To return to the top level directory of the drive, type only a backslash after the CD command. To go up one level in the directory structure, type two periods (..) after the CD command.

To switch between drives, all that is required is the letter of the drive, plus a colon, typed at a prompt. For example, typing D: <Enter> changes the active drive to D. It is important to note that DOS keeps track of a separate current directory for each drive. Changing between drives also returns the user to the directory last used on that drive. For example if a user was doing work in the business directory of the C drive (appearing as C:\BUSINESS> at the prompt), changed to the D drive to check something, then changed back to the C drive, they would be automatically placed into C:\BUSINESS>. If you change to a drive for the first time, you will automatically be placed at the top level directory of the drive.

The DIR command displays a listing of the contents of your current directory, along with the amount of space left on the drive. The output of the command typically displays the size of the files in bytes (or the word <DIR> for directories), the file or directory name, and the date the item was last modified. Often times the contents of a directory will be so numerous that several file listings will scroll off the screen. Generally you can't merely scroll back to look at what left the screen in DOS. The DIR command has several options that provide ways see the listings that scroll by. The command DIR /W provides a wide listing, minus the modification dates and file sizes, with directories enclosed in brackets to visually separate them from files. If you need the more specific information about the files, or if even the output of DIR /W scrolls off the screen, you can use the DIR /P command. This command produces the same listing as the DIR command, but it pauses after a screen-full of information at a time, waiting for a key press to continue the list. To get a directory listing of a drive or directory other than your current directory you can specify the path of the directory as a parameter: DIR <drive letter><directory name> <Enter>, or merely DIR <directory name> <Enter>, as appropriate.

File Name Extensions

In DOS, you are limited to eight character file names, with the option of a three character "extension" after a period. File extensions are used to denote certain types of files, so that programs know what sort of file they are. Though a file name extension can contain any three letters, there are some common extensions that are used. The extension .TXT is often used with plain textfiles, .DAT with data of some sort, .SYS and .COM for systems files and certain basic DOS functions, .EXE for operable programs, and .BAT for textfiles that contain "batch" commands, usually used by the computer to perform specific tasks (for example, the file AUTOEXEC.BAT is run by the computer as the machine boots up). Files with the EXE, COM and BAT extensions are files that can be run by the user. You can merely type the file name as a command, without the period or three character extension, to run them. Typically you won't need to run ANY.BAT files; they will be run by themselves at the appropriate time by either DOS or individual pieces of used software. More advanced users may create their own .BAT files to quickly carry out an array of tasks.

This isn't an exhaustive list of file name extensions to be sure. Many pieces of software create files with their own special extensions to help identify files specifically for use with that particular package. MegaDots uses .meg to identify a MegaDots document fil. Extensions such as .wp used by the word processor "Word Perfect" and .wql created by the spreadsheet package "Quattro Pro" are but two of many examples. With time and use, these will be learned and understood at a glance.

Working with Your Computer

Because DOS was designed for simpler computers, the tasks it can perform are relatively simple. It really doesn't do much more than manage files and directories, and run commands and programs.

To create a directory, use the MD command. Typing MD NEWWORK <Enter> will create a directory named newwork. In DOS, directories are limited to eight character names, just like files. Generally directories are left without a file name extension. The RD command will remove a directory, but not if the directory contains any files or sub-directories of its own. In that case, you will have to remove the files and sub-directories first before RD will work.

Copying files from one location to another is easy. Given a source file, and a destination for the copy, the copy command will duplicate the file. Typing COPY SOME.TXT D:\STORAGE <Enter> would copy the file SOME.TXT to the storage directory on the D drive. Similarly, you could type COPY D:STORAGE\SOME.TXT to copy the file to your present working directory. Note that if you omit the destination, DOS assumes you mean the current directory. A successful operation might look something like this:

There are several other useful commands for file manipulation. To view a plain text file without the benefit of a text editor, you can use the type command along with the file name. Note that most files are large enough to scroll off the screen in a rapid fashion. If your document is longer than a few lines, hitting the Pause key (on the top row of keys, at the far right) will start and stop the display. To abort the command in the middle of a file, hold down the Control key (often labelled Ctrl) and press the letter C. Most versions of DOS will have a built-in editor of some sort, allowing you to just type EDIT <file name> <Enter> to open and edit a file. This is a good substitute for playing catch up with rapidly scrolling text and also allows you to actively move around in a file, instead of merely from start to finish as type allows.

To remove a file, you can simply type DEL <file name> <Enter>. If you wish to change the name of the file, use the rename command.

Typing REN FILE.TXT NEW.TXT <Enter> will change the name of FILE.TXT to NEW.TXT. Note if the new file name already exists, an error will be displayed and the original file will not be renamed. If you wish to overwrite an existing file, you will need to use the copy command instead. If you have a large number of files to work with, use "wild cards" to make your file handling a little easier. Instead of having to type in every file you want to copy for example, you may be able to use a couple of special characters to specify a group of files. This would be analogous to some degree to highlighting several files in Windows before dragging them somewhere, or performing some other operation. Wild cards are used in place of parts of the file name specified; you can use * and ? to take the place of characters to denote a larger group of files. For example, if I wanted to copy all the files in the current directory with the extension of .SIM to a floppy disk, I could type COPY *.SIM A:. Similarly, if I had a group of files that only differed by a couple of characters in the same place in their file names, I could use a ? to stand for the character in question. If I have three files named sam sbm and scm, I could type COPY S?M A: <Enter> to copy all three files. Note that whereas one * may denote one or more characters, you must use one ? for each character you intend to replace. Be careful of typing COPY S*M <Enter> in that situation; some versions of DOS will not read this correctly, ignoring one or more of the additional characters. The * is best used to stand for a group: either all file names with a certain extension, or all extensions of a certain file name. When in doubt, using ? is the safest. You can check what files are denoted by a set of characters and wildcards with the DIR command, typing DIR *.SIM <Enter> for example.

Should you ever be abruptly greeted with a DOS prompt, or merely wish to play some games you found on the Internet, these commands will help you hit the ground running. Your DOS manual, as well as many fine texts in your local bookstore, will provide you with Many chapters of useful information on getting the most out of DOS.