Home

Mastering DOS Basics

|
|  Updated:  
2016-03-26 22:45:37
|   From The Book:  
DOS For Dummies
Explore Book
Buy On Amazon

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:

C> WP

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:

C> CALC

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:

C> DIR

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

C> DIR /P

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

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

C> DIR /W

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:

C> DIR A:

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:

C> TYPE FILENAME.EXT

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:

C> TYPE LETTER.DOC

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.

About This Article

This article is from the book: 

About the book author:

Dan Gookin has been writing about technology for 20 years. He has contributed articles to numerous high-tech magazines and written more than 90 books about personal computing technology, many of them accurate.
He combines his love of writing with his interest in technology to create books that are informative and entertaining, but not boring. Having sold more than 14 million titles translated into more than 30 languages, Dan can attest that his method of crafting computer tomes does seem to work.
Perhaps Dan’s most famous title is the original DOS For Dummies, published in 1991. It became the world’s fastest-selling computer book, at one time moving more copies per week than the New York Times number-one best seller (although, because it’s a reference book, it could not be listed on the NYT best seller list). That book spawned the entire line of For Dummies books, which remains a publishing phenomenon to this day.
Dan’s most recent titles include PCs For Dummies, 9th Edition; Buying a Computer For Dummies, 2005 Edition; Troubleshooting Your PC For Dummies; Dan Gookin’s Naked Windows XP; and Dan Gookin’s Naked Office. He publishes a free weekly computer newsletter, “Weekly Wambooli Salad,” and also maintains the vast and helpful Web site www.wambooli.com.