A QUICKY GUIDE TO DOS by Gary Nored Why Should I Learn DOS? It has been often said that you can do a lot with a computer without ever learning anything about DOS. And that is certainly true. But you can work more efficiently and safely if you do know a little bit about DOS. DOS is really not hard to use -- it's just hard to get started with because it's so cryptic. This article is intended to help you get started. What Is DOS? DOS is really two things. One is a computer program which operates 'behind' or 'underneath' other programs and which gives your computer its personality. DOS takes care of details like writing files, interpreting what is going on at the keyboard, and putting things on the screen. You need never worry about that part of DOS because it does this part of its work invisibly. The other part of DOS is more like a library of programs or a toolkit of computer tricks. As you work on different jobs, DOS saves your work in 'files' on the disks. there can be many files on a disk, but DOS helps you keep track of them all. One of the tools in the DOS toolkit is a program that can show you a list of your files at any time. Other tools help you make copies of your work, remove old work from your disks, and assign new or different names to your jobs. Some of your DOS tools remain in the computer's memory, available for use all the time. The DIR command (which means "show me a list of all the files on my disk"), the DEL command ("delete this file from the disk"), the COPY ("make a copy of this file"), and the REN command ("rename this file") are examples of the tools, or commands, that always reside in the computer's memory. Most DOS tools, however, are stored as files on a disk. You have to have a copy of them on a disk somewhere in the computer before you can use them. USING DOS To use DOS you speak to it using little DOS sentences. The rules, or "syntax" for making a DOS sentence are pretty straightforward. The first rule says that you must always separate each word in the sentence with a space. That's a lot like writing in any other language. The second rule says that you must type each word in the proper order. The final rule says to finish each DOS sentence by pressing the key. ONE-WORD SENTENCES. The simplest DOS sentence has just one word, a verb. In DOS, verbs are called commands. We'll use "commands" from now on to help you get used to the terms you may later encounter in your DOS manual. Here's an example of a one-word DOS sentence: DIR If the bottom line on your computer screen said A> when you typed this sentence, DOS would give you a DIRectory, or list of the files on the disk located in the disk drive with the name A:. TWO-WORD SENTENCES. Some DOS sentences have two words. The second word in a DOS sentence is the object of the command. The object can be anything the command understands. For example, we can ask for a directory of the files located on any drive in the computer. To see the files on drive B: you would type DIR B: . Just as many languages have different endings for different words, DOS has different endings for some of its commands. The endings, called switches, usually improve the way the command works in certain situations. For example: DIR/P will make very long lists of files stop at the end of each screen so that you have time to read them all. Another: DIR/W will put the list into five columns so that you see more file names on the screen. You can even combine endings; DIR/W/P would put the list into five columns AND stop the listing at each page. The switches are different for each command. To use them you have to learn them -- just like any other language. Fortunately, you probably won't need to use very many of them. THREE-WORD SENTENCES. One of the most common DOS sentences is also the longest possible one. It has three words which tell the computer to COPY something. It's also the most complex because you have to tell DOS (1) what you want to copy, (2) where you want to put it, and (3) what you want to call the copy. Let's say you've written a letter and saved it to a disk using the file name PAYME. The disk is currently in the A: drive and you want to copy it to a disk in the B: drive. You want to use the same name for the copy as for the original. The last line on your computer says A>. Here's the command: COPY PAYME B: In this sentence the first word tells the computer to copy something; the second word tells the computer what to copy; the third word tells the computer where to put the copy and what to call it. If you wanted the copy to have a different name, for example IPAIDYOU, you would put the new name right after the B: like this: COPY PAYME B:IPAIDYOU . Notice that there is NO SPACE between the B: and the new file name. That's because you must use different punctuation to separate parts of filenames and their locations. Specifically, use a colon to separate the drive name (usually A:, B:, or C:) from the first part of the file name. Use a period to separate the first part of the file name from the last part. Here's an example. If the above file was on a disk in the A: drive, its complete name would be A:IPAIDYOU. If your file had a last name (called the "extension" in DOS jargon) of DOC, its complete name would be A:IPAIDYOU.DOC. If the same file was on a disk in the B: drive, its full name would be B:IPAIDYOU.DOC. Since this is the hardest part about learning to use DOS, here's the information in a table. PUNCTUATION MARK FUNCTION ________________ __________________________________ Space Separates words in a DOS sentence. / Tells DOS that you intend to use a switch : Separates the drive letter from the file name . Separates the file's first name from its last name ________________ __________________________________ Let's look at the first copy sentence again. COPY PAYME B: What will be the name of the new file on drive B:? The answer -- PAYME. Why? Because whenever you don't tell DOS exactly what you want it to do, it just uses the last thing it heard. In this case the last file name DOS heard was PAYME. So DOS used the name PAYME for the new file name when it made the copy. Lets look at another example. Suppose you wanted to copy a file located on the B: drive named PAYME onto a disk in the A: drive. The last line on your screen says A>. The following sentence will do the job: COPY B:PAYME . What will happen here? Well, DOS will make a copy of PAYME on the disk located in your A: drive. Why? DOS put the copy on the A: drive because DOS was looking at the A: drive (that's what the A> on your screen really means) when it started. DOS named the copy PAYME because that's the last file name DOS knew anything about. In fact, anytime you leave things out of a DOS sentence, DOS just fills in the blanks. Here's how DOS fills in the missing information in the sentence above: COPY B:PAYME A:PAYME . Why not just type in the whole sentence? Of course, you could, but the less you type, the fewer errors you're likely to make, right? Letting the computer do it will ensure that the file gets copied under the name you really want. WILDCARDS If DOS allowed only statements like the ones we've been studying, it would take a lot of time and typing to copy all the files on a disk to a backup disk. But DOS has two other tools that help with big jobs like that. The first tool is the "*." Anytime you use an asterisk you tell DOS to match any character or characters it sees for the operation. Put another way, any time you use a "*" you're telling DOS that you don't care how many characters are in the file name, or even how the name is spelled. So: COPY A:*.* B: will copy all the files on the A: drive to the B: drive. Why? Because you've just told DOS to copy all the files, no matter how their names are spelled, from the A: drive to the B: drive. The instruction: COPY A:*.COM B: would copy all the files with the last name COM to the B: drive. The instruction will ignore the spelling of all the first names. You will probably use the following command often: COPY A:*.* B: The *.* command copies all the files from one disk to another. Great for backing up all your files at one time. There is another wildcard, the "?" that's similar, except that it matches only one character at a time. Use one question mark for each character in the filename you expect to change. For example: COPY A:FILE? B: would copy any file on A: with a name in which the first four letters were FILE and the fifth letter was any character. Using the command above would copy all of the files listed below to the B: drive in one step. FILE0 FILE1 FILE2 FILE3 FILE4 FILE5 FILE6 FILE7 FILE8 FILE9 By using the "?" wildcard, you've done exactly the same amount of work as if you'd typed the following list of commands: COPY FILE0 B: COPY FILE1 B: COPY FILE2 B: COPY FILE3 B: COPY FILE4 B: COPY FILE5 B: COPY FILE6 B: COPY FILE7 B: COPY FILE8 B: COPY FILE9 B: Just imagine how many mistakes you might have made doing the job that way. You can also use wildcards to good advantage when removing unwanted files from a disk. For example: DEL *.BAK will delete all files with the last name BAK, no matter what their first name. BAK is a popular last name for backup files created automatically by your computer, and sometimes you might want to take some of them off to make more room on a disk. Try the wildcards with the DIR command for practice. Typing: DIR *.COM will give you a list of all the files on your disk with the last name COM. FORMAT One powerful DOS command everyone has to learn how to use is the FORMAT command. You must FORMAT each new disk you buy to create data spaces on a disk in patterns your particular computer can recognize. The FORMAT command creates these data spaces. If you have two floppy disks put DOS in the A: drive and a new disk in the B: drive. Make sure that DOS is "logged" (looking at the A: drive by typing A: before you start. Then type: FORMAT B: to prepare the disk. Let's say that you've just bought the latest version of a word processor called "Purple Prose." You would like to be able to put your Purple Prose disk into the A: drive, turn on the computer, and start writing -- without having to flip a bunch of disks around. What you need is a copy of Purple Prose on a "system" disk. A system disk contains hidden files the computer needs to put itself together when you first turn it on. To format a system disk, use the command: FORMAT B:/S Format will create a disk containing the hidden files it needs for its own "system" purposes. FORMAT is the only truly dangerous command in DOS and it's most dangerous to hard-disk owners. Always be careful to specify the drive containing the new disk. If you don't, and you keep answering "yes" to the formatting questions, DOS may just do what you say and format itself out of existence! CONCLUSION Now that you know a little more about DOS, try using it. First make a backup copy of a disk you have a lot of data on. Use the COPY *.* instruction to make the backup. Then try making selective directories of your files. Try making selective group copies using the wildcards. Try the delete command using different wildcards (be sure to use a copy of your disk to practice this command -- DEL *.* has caused a lot of DOS owners a lot of grief)! Try reading about the REName and other commands in your DOS manual and using them. Most of all, just PLAY with these instructions and find out what they do. Sometime, someday, one of them is going to rescue you from a situation you could never have fixed on your own before. And THAT is a great feeling! THE END