Mastering DOS Basics - dummies

By Dan Gookin

You get work done on a computer by running a program. If you’re lucky, somebody has set up your computer so that it automatically runs the program you need. Turn on the PC, and — zap! — there’s your program. The only time you have a problem is when something goes wrong and the program crashes or doesn’t turn on like it’s supposed to. (Or, while you were at lunch, Petey from the mailroom came in and played games, leaving you with a C> on your screen to puzzle over.)

If you’re on your own and nothing seems to happen automatically, you need to start a program yourself. Here’s how:

First, you need to know the program’s name. Then, you type that name at the command prompt.

For example, WordPerfect is named WP. To run WordPerfect, you type WP at the DOS prompt and then press Enter:


To run Lotus 1-2-3, you type 123 at the DOS prompt and press the Enter key.

You can also run Windows programs from the DOS prompt if you are running Windows. For example, to start the Calculator program, type CALC at the DOS prompt:


Press the Enter key, and the Calculator program pops up on-screen. (Your DOS prompt window doesn’t go away; just click it with your mouse to continue using DOS.)

  • If your computer is set up to run some sort of menu system, try typing MENU at the DOS prompt to run it.
  • Other terms for running a program include loading a program, launching a program, and starting a program.
  • Alas, you can’t run Windows programs from a DOS prompt in Windows 3.11. If you try, the computer informs you that the program requires Microsoft Windows.

Under DOS, all program files are named with a COM, an EXE, or a BAT ending (called a filename extension). Don’t bother typing that part of the name at the DOS prompt — and you don’t have to type the period that separates COM, EXE, or BAT from the file’s name.

Using the DIR command

The most popular DOS command is DIR, which displays on-screen a list of files on a disk. This command is how you can find which programs and data files are located on a disk. DIR is especially helpful if you’re missing something; it helps you locate that document or spreadsheet you were recently working on.

To see a list of files, type DIR at the DOS prompt and press Enter:


If the list is too long, you can type the following DIR command:


The /P makes the listing pause after each screenful of files.

To see a list of filenames only, type the following DIR command:


The /W means wide, and it gives you a five-column, name-only list.

If you want to see the files on a floppy drive, follow the DIR command with the letter of the floppy drive:


In this example, DIR is followed by A:, indicating that the command should list files on any disk in that drive. (You should have a disk in the drive before you use that command.) If you want to find out which files are on drive B, for example, substitute B: for A:.

  • You can use the DIR command to find files by name as well as to locate files in other subdirectories on the disk.
  • The output of the DIR command shows a list of files on your disk. The list has five columns: the file’s name, the file’s extension (part of the name), the file’s size (in bytes or characters), the date the file was created or last modified, and the time of the last modification.
  • In Windows, the DIR command’s output has size columns. The final column displays the long version of the filename (if there is one).

Looking at files

Two types of files are on a PC: English and Greek. You can use the TYPE command to display any file’s contents. You can read the ones in English (or ASCII). The files in Greek — they’re actually in secret computer code, but it may just as well be Greek — are program files or data files or any other stuff you can’t read.

To look at a file, you must know its name. (If you don’t know the name, you can use the DIR command; refer to the preceding section.) You type the file’s name after the TYPE command and a space:


Press Enter to see the contents of the file, which is FILENAME.EXT in the preceding example. To see the contents of the LETTER.DOC file, for example, you would enter the following command:


The file is then displayed on-screen.

  • A simple way to view — and edit — text files is to use the DOS Editor.
  • If you get a File not found error message and you’re certain that the file exists, you probably mistyped its name. Reenter the command and check your typing. Alternatively, you can use the DIR command to verify that the file exists.
  • Text files usually end with TXT in their filename. The DOC ending is also popular, though DOC doesn’t necessarily mean that it’s a text file. Some common text filenames are READ.ME and README and sometimes README.TXT.
  • You can’t see all files, even though your application may display them perfectly. These “Greek” files typically contain special codes and functions for the computer, stuff that the program eats and then spits back at you as non-Greek information. Unfortunately, the TYPE command just isn’t that smart.