Printer Friendly

MS-DOS basics: behind the scenes.

Using a computer should be like riding a bicycle - swerve, spin, loop, bank, zip around on impulse. Instead, it's like riding a bicycle on a tightrope. And, having to learn computing on the IBM personal computer is like having to learn to drive in a shift car. In the Himalayas. - Ted Nelson*

MS/PC-DOS, the dominant operating system for the IBM PC/X'T/ AT and clones, has been justifiably criticized for its obtuseness and difficulty. If the term "User-hostile" were applied, no one would think- it hyperbolic.

But many librarians using computers are using an IBM PC/XT/AT or a clone, and this makes learning DOS a necessity. With this colunm, I am beginning a series that will explore DOS and try to explain some of its lesser known Commands and features. Along the way I hope to show you some tricks and techniques that will make your use of DOS easier and your computer more productive. At the end of the last column, I will be sharing my personal bibliography of most the useful DOS books.

To begin, it may be helpful to look at some of the things that DOS does behind the scenes that you may not know. When you switch on (or boot) your PC, there is a time lag before your computer starts to do anything. This is the time it needs to check its internal circuits, memory, and peripherals (such as printers, modems, and hard drives) and make sure they are all iii working order. Your PC has this procedure permanently stored in its chips, and it cannot be altered by users.

*Ted Nelson, Computer Lib/Dream Machines. Tempus Books (revised edition, 1987). This is a wonderful book that I highly recommend. This is definitely not just for computer junkies, but can be enjoyed by anyone who likes lucid prose and stimulating ideas.

Once this routine has been done, the computer goes to Lhe floppy disk drive to look for a disk with the DOS system files. If it does not find a floppy disk and you have a hard drive, the computer immediately looks there for the system files. There are three such files that the computer must find before you get your familiar DOS prompt; the names of these three vary, depending on your version of DOS. On most IBM PCs they are called IBMBIO.COM, IBMDOS.COM, and COMMAND.COM. COMMAND.COM contains the instructions for the internal commands with which most DOS users are familiar (and which many users learn first). These include DIR, COPY, CLS, MD, RD, and CD. The other two files contain other necessary information for using the disk drives, monitor, and peripherals.

Once all this information has been loaded into your computer's memory, it next looks for files called CONFIG.SYS and AUTOEXEC.BAT. If these are present the commands in each are executed and, depending on the commands in diem, either a prograrn is run or the DOS prompt displayed. Only after all this is the computer ready for you to begin working.

For many users, myself included, the naked DOS prompt was somewhat intimidating at first. I remember not knowing how to change the default drive from B: to A: and turning the computer off mid on to get back to A:. If you're still at this point, don't worry - it gets better. DOS is a constant source of irritation because of what it won't do, but what it achieves with just a few dozen commands is quite remarkable.

Internal Commands

DOS commands come in two flavors internal and external. The intemal commands are loaded into RAM by COMMAND.COM. These are tile ones most users learn first and include DIR, COPY, REN, CHDIR, MKDIR, all the batch file commands, as well as several more. Internal commands can be given at any time and because they are kept in memory the computer immediately carries out the instructions.

DOS has a definite hierarchy when it comes to executing commands. First it checks to see whether the command you have entered is one of its intemal commands; if not it looks in the directory in which you are working for a file with the same name as the command you entered and an extension of COM. Not finding one of these, it looks for a file of the same name with an .EXE extension, then one with a .BAT extension. If none of these exist in the current directory, DOS looks in the PATH you have established, if it exists. Only after exhausting all those avenues will you see the message "Bad command or file name."

Knowing this about DOS will help you in naming your files. For example, you cannot have a batch file named DIR.BAT and expect it to do anything. Every time you typed DIR and expected DIR.BAT to be run, you would instead get the directory list of files. Strictly speaking, it is not impossible to modify COMMAND.COM so that you can use a file named DIR.BAT, but usually it's easier to just rename your batch file.

Using Wildcards

DIR is a plain vanilla command, yet serves to illustrate some of the flexibility found in DOS. Most users issue the DIR command when they need to see a list of files, either in the directory where they are working or somewhere else on the disk. Simply typing DIR will produce a fist of the files in the current directory. By using wildcards, you can find a specific file or group of similar files. The two wildcard character specified by DOS are * and ?. The star can replace from one to eight characters, depending on where it's used in the command.

For example, DIR *.COM will find all the commands whose extension is .COM. Tne number of characters in the file name is not important. Similarly, COMMAND.* will find all files named COMMAND regardless of extension. * can also be used to signify characters in the middle of file names. COM*.COM will retrieve such files as COMMAND.COM, COMMANDO.COM, COMA.COM, COM.COM, and so on.

When using the star, be careful where you place it. As soon as DOS reads it, it disregards everything to the right. So *OM*.COM will not retrieve TOMATO.COM or COMMAND.COM. It is functionally equivalent to typing DIR *.COM. If you wish to replace one character at the beginning of the command, use?. The question mark replaces one character and can be used anywhere in the file specification. You can use as many as you need. Typing DIR ????????.EXE accomplishes the same task as DIR *.EXE, if in a somewhat more cumbersome way. You are not limited to listing files in the current directory. Simply typing the subdirectory name immediately after the DIR command will pull up that directory's files.

For example, if you have a directory named DATA on your disk, typing DIR C:\DATA\*.DBF will list all the DBF files in that subdirectory, on your C: drive. If the files are on a different disk, simply replace the C: with the correct drive identifier. Wildcards work just as well with COPY, ERASE, REN, and PRINT. Without wildcards, backing up a hard disk to floppies would be laborious at best. But by simply typing COPY *.* A: you can quickly back up an entire subdirectory to a floppy diskette.

Be careful when using wildcards with ERASE (or its shorter twin, DEL.) You can very easily destroy hours of hard work, if you are not careful. DOS provides a kind of self-check for you whenever you enter DEL *.* by asking "Are you sure (Y/N)?" It's always best to double-check your command before pressing <Enter>. I have, more than once, obliterated entire subdirectories by typing DEL *.*, thinking I was cleaning up a floppy, but forgetting to specify that it was the A: drive where I wanted to erase die files. All disks need to be periodically cleansed and wildcards can make the job much smoother, but be very careful or you may end up losing much more than you anticipated.

Using Switches

In addition to wildcards, DOS lets you vary how its commands operate through the use of switches. Switches are like addenda to commands that add extra functionality. Switches are always added with a forward slash.

COPY has three possible switches. When you type COPY A:*.COM C:\UTIL, /V, DOS will copy all COM files on the A: drive into the UTIL subdirectory on your hard drive. The IV instructs DOS to verify that the copied files are identical to the original. COPY's other switches are used to specify whether the files you are copying are ASCII text files or binary program files. Under most circumstances you will not need to use these switches. If you want to explore their use, I'll refer you to your DOS manual or favorite DOS reference book.

Another command with which you will use switches frequently is FORMAT. FORMAT is an external DOS command, which means you can offly use it if it is in the same directory as the one in which you are currently working or if its directory has been specified in your PATH. FORMAT A: /S tells DOS to format the floppy disk in the A: drive and after finishing, the system files necessary to booting the computer are to be added. FORMAT A: /S /V allows you to add an eleven character volume label to die disk you have formatted.

If you are using an IBM AT-compatible, such as tile OCLC M310, you most likely have as your floppy disk drive a high-density, 1.2-megabyte drive, rather than the 360-kilobyte drives found on IBM PC/XT compatibles. This means die disks you format can hold over three times as much data as the older format, but you cannot read them in the old drives. Fortunately, you can read 360kilobyte disks in the newer drives, and you can format disks for 360 kilobytes in them. To do this type FORMAT A: /4. You can add other switches as well, but the /4 instructs DOS to format for 360 kilobytes.

The ability of the newer versions of DOS to format in either format allows users the flexibility of carrying data from one machine to another or passing along documents that need to be read and approved by more than one person. Unfortunately, some high-density drives write unreliably to 360-kilobyte disks. I have had the XT clone I use at home refuse to read die data I had copied at work on an AT-class computer. On the AT clone I use at work now, though, I have had no problem. I carry disks back and forth all tile time. It seems to depend entirely on die drive.

CHKDSK is another extemal command with which you can use switches to enhance your computer use. CHKDSK reports on memory use, number of files on your disk, and file fragmentation. It can be used to repair file fragmentation through use of the /F switch, or it can show all the files on a drive with the IV switch.

Next time we'll look at some of DOS's other features, including filters, piping, file redirection, and hard disk management. Until then, begin to take advantage of DOS's flexibility and options. Your computing time will become more productive and rewarding.
COPYRIGHT 1989 Information Today, Inc.
No portion of this article can be reproduced without the express written permission from the copyright holder.
Copyright 1989 Gale, Cengage Learning. All rights reserved.

Article Details
Printer friendly Cite/link Email Feedback
Title Annotation:tips for libraries
Author:Dykhuis, Randy
Publication:Computers in Libraries
Date:Sep 1, 1989
Previous Article:SeniorNet: computer skills for senior citizens.
Next Article:Memories: the Mac and more.

Terms of use | Privacy policy | Copyright © 2019 Farlex, Inc. | Feedback | For webmasters