Robert W. Weeks bob.weeks@cox.net, http://members.cox.net/bob.weeks

Beginning Exercises

To start our class, let's use two popular software programs, WordPerfect and Lotus 1-2-3. We'll create simple examples of work in each product. Don't worry too much about what's happening right now. As the class proceeds, you'll learn more about what you did, and why you did it.

Using WordPerfect 5.1

Start the WordPerfect software program (your instructor will give you the command to use).

The WordPerfect software loads from the hard disk drive to the RAM memory.

Type in a sentence or so of text. You can type anything you like.

The information you type appears on the computer's screen, and is also stored in the computer's RAM memory.

Press F7, WordPerfect's Exit key.

It's located along the top row of the keyboard.

Answer Y to the question. Press the letter Y, but don't press the Enter key or anything else.

Tells WordPerfect that we want to save our document to the disk drive.

Type c:\data\letter.wp and press the Enter key.

This supplies the name of the disk drive and the file name and saves the file from RAM memory to the disk drive. Note the use of the backslash key, located above the Enter key.

Press Y to exit WordPerfect.

WordPerfect is finished, and control of the computer system returns to DOS.

Using Lotus 1-2-3 Release 2.2

Start the Lotus 1-2-3 software. Your instructor will give you the command to use.

The Lotus 1-2-3 software loads from the hard disk drive to the RAM memory.

Press the Enter key.

This moves from the Lotus 1-2-3's Access System to the main program.

Type Sales and press the Down Arrow key.

Enters a label into the spreadsheet. The data appears on the screen, and is stored in the computer's RAM memory.

Type Costs and press the Down Arrow key.

 

Type Profit and press the Down arrow key.

 

Using the arrow keys, move to cell B1.

This is where we want to type some more data.

Type 100 and press the Down arrow key.

 

Type 35 and press the Down arrow key.

 

Type +B1-B2 and press the Enter key.

This enters a formula into 1-2-3, and calculates the result.

Press the slash key.

1-2-3 uses the slash key to start a menu command.

Type FS.

Issues the File Save command, to tell 1-2-3 that we want to save our work to disk.

Press the Escape key twice.

This clears away the existing drive specification.

Type c:\data\income and press the Enter key.

This names the worksheet and saves the worksheet to disk. Note the use of the backslash key, located above the Enter key.

Press the slash key, and type QY.

This issues a menu command that tells 1-2-3 that you want to quit.

Press E.

Tells 1-2-3 that we want to quit the Access System and return to DOS.

Using Your Computer

Turn on the computer

Diagnostics
Load DOS from disk to RAM memory

When you first turn on your computer, it usually goes through a diagnostic test and other preliminary tasks. Then, if the test is successful, the computer loads DOS, the operating system, from either a floppy diskette or hard disk to the computer's RAM memory. After this, the computer may ask you to enter today's date and time, or if the computer has a built-in device to provide the date and time, it probably won't ask you.

Computer displays the DOS prompt

After the computer loads DOS and gets the date and time, it displays the DOS prompt, which is usually C:\>. At this time, you're using DOS, you're ready to enter commands to the computer.

Use Lotus 1-2-3

One command you might enter to the computer is the command to start using Lotus 1-2-3 or some other software program. To use a program, you generally type the program's name or abbreviated name. At this time, the computer loads the software from a disk drive to the RAM memory, and you can start using the program. While you're using a software program, you generally don't have access to other programs or DOS commands.

Create a worksheet and save it

When you're using Lotus 1-2-3 and entering numbers and formulas, the data you enter is held in the computer's RAM. Once you save it to the disk drive, it becomes a file on the disk and is saved permanently.

Quit Lotus 1-2-3 and return to DOS

Once you're finished building and saving the worksheet, issue the quit command to leave Lotus 1-2-3 and return to the DOS prompt. At this time, you can use another program such as a word processing or database program, or you can use DOS commands.

Use DOS to format a blank diskette

You decide that your colleague could benefit from using this worksheet, so you'd like to make a copy of it on a floppy diskette. But the only diskettes you have are still in the box and unused, so you use the DOS format command to prepare one to receive data.

Use DOS to copy the worksheet file

Once you format the diskette, you use the DOS copy command to make a duplicate copy of your worksheet on the blank, formatted disk. Then you give this disk to your colleague.

Use a word processing program

After finishing with the worksheet task, you need to make some revisions to a proposal you wrote yesterday. You start Microsoft Word by typing word and the computer loads the Word software from the disk to the computer's RAM memory. Then, you load the saved version of the proposal from disk to RAM memory and make the revisions, saving the updated version back to disk when finished. Finally, you print the report using Word's print command.

Make backups

Since the two files you've created (the worksheet file and the proposal file) represent an entire day's work, you use the DOS backup command to make copies of the files from the hard disk drive to floppy diskettes. Or, if the files were created on floppy diskettes, you use the DOS copy command to copy the files to another diskette for safekeeping.

Computer Components

Processor

The computer's processor or microprocessor is a single chip in the computer where the computer performs computation and decision making.

Memory

The computer's memory, often called RAM (Random Access Memory), is where the computer holds data while it's working with it. RAM provides fast, short-term storage.

Disk Drives

The computer's disk drives, either floppy diskettes or a hard drive, provide permanent, long-term mass storage. After creating something in RAM memory, you usually save it to a disk drive so it will be there tomorrow or next year.

Peripherals

Peripheral devices such as displays, keyboards, mouses, and printers usually perform input-output functions, letting you get data into or out of the computer.

Software

Operating System
Applications Software

Software is what makes the computer perform useful work. In many ways, the computer is like a record player. Just as you buy a record player to play records and produce music, you buy a computer to "play" or run software. The software you purchase determines what your computer will do. If you buy a spreadsheet program like Lotus 1-2-3, you'll be able to do calculations. Word processing software lets you computer act as a sophisticated typewriter. Database management software lets you keep track of and organize data.

Computer software is divided into two types: systems software like the operating system, and applications software such as spreadsheet, word processing, or database software. Systems software, in particular the operating system, provides the foundation that applications software runs on.

You

You are the most important part of the computer system. The computer, after all, possesses none of the type of intelligence that humans do. You'll find that the computer is a very capable assistant, willing and able to perform voluminous calculations, reorganizations, sorts, and other tasks at your command. But in most cases, you first must tell the computer what formulas to calculate, how to reorganize the data, and how to sort.

Intel Microprocessors

The computer's processor is one of its most important parts, as it is in the processor that all the computations are performed and logical decisions are made. IBM did not develop the PC's processor internally. Instead, they bought processors from Intel Corporation. This is an important fact, as other companies could purchase the same processors that IBM used--one of the essential conditions for the birth of IBM PC compatible computers. There are three main Intel processor families in use today.

Intel 8088 and 8086, NEC V20 and V30

These Intel processors are used in the IBM PC and XT, the IBM PS/2 Models 25 and 30, and compatible computers. Clock speeds range from 4.77 MHz in the original PC to about 10 MHz in the faster computers.

The 4.77 to 10 MHz refers to the computer's clock rate. Inside the computer, a quartz oscillator emits a clock pulse that controls the speed of the processor and coordinates other activities in the computer. Generally speaking, the faster the clock rate, the better the computer's performance.

The 8088 and 8086 are 16-bit processors internally. The difference between the two is that the 8088 communicates with the outside world (particularly the RAM memory) eight bits at a time, while the 8086 communicates 16 bits at a time.

The NEC V20 and V30 are processors developed by NEC that are compatible with the 8088 and 8086. Through internal improvements, these processors are faster than the Intel equivalent. You can buy these processors for under $20 and replace the 8088 or 8086 directly. The performance increase is modest, with about a ten percent increase in speed under most conditions.

Each of these processors can address 1,024 KB (one megabyte) of memory. IBM reserved some of this address space for its own use, leaving 640 KB for memory. This is the basis of the infamous 640 KB DOS RAM memory limitation.

Intel 80286

The Intel 8026 is the basis of the IBM PC AT, computers compatible with the AT, and the IBM PS/2 Models 30 286, 50 and 60. Clock speeds range from 6 MHz in IBM's original AT, to 16MHz in the fastest compatibles. Ten or twelve MHz is most common.

Initially, the AT ran the 80286 processor at 6 MHz, while the PC and XT ran the 8088 at 4.77 MHz. Yet, the AT performed about three times as fast as the PC, even though the clock rate was only 25 percent faster. The extra speed increase comes from the 80286's ability to perform more work than the 8088 in each clock cycle and illustrates that clock speed is not a total measure of system performance.

The 80286 features two modes of operation: real mode and protected mode. In real mode, the processor acts as a fast Intel 8088 or 8086 processor, with the same 640 KB memory limitation. In protected mode, the processor can directly address up to 16 MB of memory, known as extended memory. Most common DOS programs operate in real mode, so they can't make use of this extended memory. One of the major features of IBM's OS/2 and Microsoft Windows 3.0 is their ability to use the full 16 MB of extended memory.

Furthermore, the 80286, when running in protected mode, offers hardware features that let two or more programs run at the same time (multitasking). The key feature is that the processor can protect each program from the other (hence the name protected mode). The 8088 and 8086 can't do this. It's possible to implement multitasking on the 8088 and 8086 through software (Desqview and related products), but it's not as efficient or reliable as the 80286's hardware multitasking. OS/2 exploits these feature of protected mode to offer multitasking.

Intel 80386 and 80386SX

This Intel processor is used in the IBM PS/2 Models 70 and 80, the Compaq Deskpro 386 series, and compatibles. Clock speeds range from 16 to 33 MHz.

The 80386 offers all the features of the 80286. It can address even more memory, up to four gigabytes (1,048,576 KB). It offers a virtual 8086 mode in which the 80386 simulates a number of 8086 processors operating concurrently. Microsoft Windows 3.0 and other programs take advantage of this capability to provide effective multitasking of ordinary DOS programs.

Intel later introduced a model of the 80386 processor called the SX. While the original 80386 processor communicates with memory 32 bits at a time, the SX communicates 16 bits at a time. This means that it is quite a bit less expensive to build a computer around the SX. SX-based computers run at 16 or 20 MHz and don't run quite as fast as computers based on the regular 80386, but will run all the advanced software available for the 80386. These computers generally offer a good comprise between performance, advanced features, and a reasonable price.

Intel 80486

This newest of Intel processors is much like the 80386, but offers even more performance. IBM uses it in the PS/2 Models 90 and 95.

Intel 8087, 80287, 80387

Math coprocessors for faster mathematical computations

The math coprocessors are an option to most computers; you must purchase it and install it in an empty chip socket most computers have for that purpose. Two notes: The math coprocessors accelerate just a few calculations, mostly transcendental functions (logarithms, exponentials, trigonometry). Regular addition, subtraction, multiplication, and division aren't affected. Second, software must support the coprocessor. Lotus 1-2-3 Release 1A doesn't, but the newer Release 2 does.

Motorola 68000, 68020, 68030, 68040

Used in Apple Macintosh and others

The most successful line of processors outside of Intel is the Motorola 68000 series, the latest of which is the 68040. These chips are used in the Apple Macintosh, the Atari 520 Series, and the Commodore Amiga. The biggest reason why these computers aren't compatible with the IBM PC is that they use the 68000 processor family--a totally different chip family that's programmed differently.

Random Access Memory (RAM)

Holds copy of software program in use
Working storage for data

Before you can use a computer software program, it must be loaded into the computer's RAM memory. This is not a difficult process; in the case of Lotus 1-2-3, you type the word lotus at the DOS prompt, and DOS loads the 1-2-3 software from the disk drive to the RAM memory. This process takes a moment to complete, and that's why there's a delay between the time you type the command to start a program and when you can actually start using the program.

Many personal productivity programs store their data in RAM while they're working with it. In the case of Lotus 1-2-3, for example, the worksheet must reside entirely in RAM while you're working with it, so the amount of RAM you have installed determines how large a worksheet you can build. But some programs--WordPerfect and many database programs, for example--use a hybrid approach, where working data is stored both in RAM and on the disk.

Composed of electronic RAM chips

To add more RAM to your computer, just buy more RAM chips and plug them in. You may, however, need to purchase a memory expansion board, which provides the space to install more RAM.

High-speed access to data

When data is located in RAM, the processor has nearly instantaneous access to it. That's the most important characteristic of RAM, and why many programs store working data there, and why software must be run from RAM rather than disk.

Volatile--loses contents with power loss

That's the drawback to RAM--if you create data in RAM, you must at some time save it to a disk, or when you turn off the computer (or even quit using the program that created the data), it is lost.

Normal, conventional limit: 640 KB

This limitation is due to the design of the Intel 8088 and 8086 microprocessors, as well as design limitations of the current versions of DOS, the computer's operating system that manages the RAM. The 80286 and 80386 processors can address more memory, but the memory above 640 KB is known as either extended or expanded memory.

Extended Memory

This memory was first introduced with the AT in 1984, and is available only on 80286, 80386, and 80486-based computers. Extended memory is one type of memory above the conventional DOS limit of 640 KB. Most computers that support extended memory can have up to 16 MB extended memory.

Extended memory is not compatible with classic DOS software, as extended memory is available only when the processor is operating in protected mode, and classic DOS is meant for real mode. OS/2, however, runs in protected mode, and uses extended memory. Microsoft Windows 3.0 too can run in protected mode and address this memory.

There are exceptions. Starting with DOS 3.0, Microsoft and IBM supply the VDISK program, which creates a RAM disk in extended memory. A few other programs use extended memory for specialized purposes such as a disk cache, and the Xenix operating system has always made use of it. Some new programs such as Lotus 1-2-3 Release 3 require and use extended memory.

Today, many AT-type computers come standard with one megabyte of RAM, typically allocated as 640 KB regular DOS memory, and 384 KB extended memory.

Expanded Memory

Expanded memory was created by Lotus, Intel, and Microsoft (and is often called LIM expanded memory) in 1984. It is available on all IBM compatible computers from the original PC through the PS/2 models. AST later created a more advanced version of expanded memory called Enhanced Expanded Memory, or EEMS. The most recent version of the LIM standard (version 4.0) allows for up to 32 MB of expanded memory.

Classic DOS programs can use expanded memory if they are modified to include support for this memory. The modification is relatively easy for software publishers to make, and by now nearly all programs that could make use of a lot of memory support expanded memory. Remember, the software must support expanded memory to use it. The first popular version of Lotus 1-2-3, Release 1A didn't support expanded memory, but the later Release 2.0 did. By now, almost any program that could benefit from expanded memory supports this type of memory.

Extended and expanded memory are two different types of memory, and generally a program will require one type or the other. Until recently, it was more common for programs to support expanded memory. Recently, however, there is a definite trend towards support of extended memory. Windows 3.0, for example, will work with either extended or expanded memory, but the greatest benefit comes when using extended memory.

Storage Measurement

It's important to know how computers measure the two types of storage they have. These units, with the exception of the bit, are used to measure bot RAM memory and disk drive capacity.

Bit

Binary digit; either a zero or one
Basis of all computation

Computers internally work in the binary or base two numbering system, where the only digits available are zero and one. (Electrically, a zero is expressed as a low voltage, and one by a higher voltage.) All data in the computer--a spreadsheet, paragraph of text, database, graphic image, whatever--is expressed as a sequence of zeros and ones.

Byte

Eight bits
Roughly equivalent to one character in word processing and database applications
Numbers often stored in four or eight bytes

The byte is a more useful unit of storage than the bit, because a byte is generally equal to one character. This is just an approximation, but is true in general use.

Kilobyte

Abbreviated K or KB
1,024 bytes (210 = 1,024)
About 1,000 characters

Although the kilobyte is precisely 1,024 bytes, in common usage a kilobyte is about 1,000 characters. A typewritten page of information generally uses two to four kilobytes of storage. Most PC's today have at least 640 kilobytes of RAM, and floppy diskette capacities range from 360 to 1,440 kilobytes.

Megabyte

Abbreviated MB
1,024 kilobytes or 1,048,576 bytes
About 1,000,000 characters

Typical capacities of hard disk drives range from 20 megabytes on up.

Additional units of measurement include the gigabyte, which is 1,024 megabytes or about 1,000,000,000 bytes, and the terabyte, which is 1,024 gigabytes or about 1,000,000,000,000 bytes. These units of measurement, of course, are larger than you'll find used in the PC world.

Differences Between Floppy Diskette Drives and Hard Disk Drives

Floppy Disk Drive

Hard Disk Drive

Removable; infinitely expandable; secure

Fixed; normally a permanent part of the computer

Since a floppy diskette is removable, if one diskette becomes full, you can use another diskette. If the hard disk drive becomes full, you'll have to erase old files from the disk to free space. Or, you can add another hard drive--most computers can use several at once.

Since the hard drive is built in the computer and not removable, if someone can gain access to your computer, they can access (and alter) your data. But you can secure data stored on a floppy diskette in the same way you'd secure valuable or confidential papers--take it with you or lock it up.

Additionally, data stored on a floppy diskette is portable. There are removable hard drives available, but they are not nearly as popular as the traditional fixed drive.

Small capacity
DSDD 5.25" 360 KB (PC and XT)
DSHD 5.25" 1.2MB (AT and 386-based)
DSDD 3.5" 720KB (Portables, early PS/2)
DSHD 3.5" 1.44MB (Most PS/2 and others)

Large capacity
10 MB to 600 MB or more

A 10 megabyte hard disk drive is equivalent to about 30 360 KB floppy diskettes. This tremendous advantage in storage capacity is the primary feature of a hard disk drive that makes it so valuable to many people.

IBM PC and XT computers (and compatible computers) use a 5.25" double-sided double-density diskette that holds 360 KB. IBM AT computers and compatible computers, as well as most 80386 computers use a 5.25" double-sided high-density diskette that holds 1.2 MB. Generally, the 1.2 MB drives can read and write diskettes in the 360 KB format.

Slow access and data transfer

2 to 20 times as fast

The average access time of a disk drive, which is the average time it takes to locate a piece of data, is the most important measurement of a drive's performance. Floppy diskette drives typically have access times of 300 to 500 milliseconds. Hard disk drives of the type found in an IBM PC XT or compatibles have average access times of 70 to 100 milliseconds, and the average access time of a hard drive that would be found in an IBM PC AT or compatible computer has an access time of 40 milliseconds or less.

Additionally, the data transfer rate, which is the rate at which the drive can exchange data with the computer, is several times greater for a hard disk drive.

Hard Disk Drives

Fast speed

Convenience
Feasibility of large projects

Everyone benefits from the increased speed of a hard drive. Programs take less time to load, and saving and retrieving data files is quicker, too. The extra speed makes it feasible to use the PC for more tasks than before.

Backup issues

DOS backup
Tape
Backup programs

You must have backup copies of data on the hard drive, as there are many ways that the data can disappear: accidental erasure or alteration, failure of the disk itself, or mishaps like fire, flood, or theft. The backup program included with DOS copies files from the hard drive to a series of floppy diskettes. This works, but is slow and tedious. Tape drives provide fast, efficient backup, but are expensive. Several companies provide alternate backup programs that make copies to diskettes, but work faster and better than the DOS backup program. These backup programs are quite popular.

Displays

IBM Monochrome Display Adapter

High-resolution, pleasant text
720 x 350 resolution
Block graphics

The resolution of the display measures the number of dots (or pixels) horizontally across the screen and vertically down the screen. The more resolution, the better--the text characters look better with higher resolution, and of graphics are better, too. The monochrome display adapter (MDA) provides very high resolution.

IBM Color Graphics Adapter

Low-resolution, harsh text
640 x 200 resolution (two colors)
320 x 200 resolution (four colors)
Bit-mapped graphics

The color display adapter (CGA) provides bit-mapped graphics, sometimes called all-points-addressable graphics. This feature puts each dot or pixel under direct control of the computer--the type of graphics necessary for bar charts, pie charts, different size characters, drawings, and of course, games. The block graphics that the MDA supplies are limited to coarse horizontal and vertical lines. The CGA's text display, however, is not nearly as pleasing as the MDA display, and the color selection is limited, too.

IBM Enhanced Graphics Adapter

High-resolution, pleasant text
640 x 350 resolution (16 colors)
Bit-mapped graphics

The enhanced graphics adapter (EGA) provides resolution approaching the MDA, but bit-mapped graphics like the CGA, but in up to 16 colors.

Multicolor Graphics Array (MCGA)

PS/2 Models 25 and 30
Up to 640 x 480 resolution (2 of 256K colors)
Bit-mapped graphics

The MCGA is a low-end version of VGA that IBM uses only in the PS/2 Models 25 and 30. It is not very important.

Video Graphics Array (VGA)

PS/2 Models 30 286, 50, 55, 60, 70, P70, and 80
640 x 480 resolution (16 of 256 colors)
Bit-mapped graphics

Currently the VGA is the highest performance graphics standard in common use. VGA is a standard feature of most of the PS/2 series and is built into these computers' motherboard. IBM and other companies sell VGA cards for other computers. IBM and Compaq recently stopped making EGA cards in an effort to move to VGA.

Hercules Graphics Card

High-resolution, pleasant text
720 x 348 resolution (monochrome only)
Bit-mapped graphics

The Hercules graphics card, often simply called a monochrome graphics card, which was not developed by IBM, provides the highest resolution graphics of any of these common display adapters. The text is very sharp, too. But this display adapter doesn't provide color.

In all cases, these display adapter cards must be matched with an appropriate monitor display. For example, since the EGA is higher resolution than the CGA, you need a higher quality display for use with the EGA.

Some computers are sold with the display adapter and monitor as part of the package; others let you choose the exact combination of display adapter and monitor to suit your needs and budget. Today, graphics capability is important, as much software such as Microsoft Windows applications uses graphics to great advantage. Color, however, is not as important. Most people will be happiest with the EGA or Hercules equipment.

PC Printers

Daisywheel (letter quality)

Typewriter-like appearance
Slow--10 to 60 cps
Inflexible
Loud
Moderate price

Daisywheel printers have a printing element that contains the character set, much as the keys of a typewriter have the characters on them. When the printer needs to produce a character, it rotates the character into position, and a hammer strikes the character. Because the daisywheel printer works much like a typewriter, the results generally look just like typewritten material. But daisywheel printers are slow (30 to 40 cps is the range for a good printer costing about $600), lack graphics ability, and are quite loud.

Dot Matrix

Poorer appearance, but 24 pin near letter quality
Fast--100 to 600 cps
Graphics
Loud
Inexpensive

Dot matrix printers compose characters from many tiny dots. Most dot matrix printers have nine pins to make characters from, and their output is "dotty" and readily recognizable as computer output. Many newer matrix printers use 24 pins, so the dots are smaller and closer together. These printers, often called near letter quality printers, can produce output approaching the quality of a daisywheel printer. Dot matrix printers are very fast in high-speed draft mode, but slower when producing near letter quality output. These printers usually offer extensive graphics capability, are loud but quieter than daisywheel printers, and can be quite inexpensive. Prices range from about $300 for a letter-size, 200 cps draft mode, 50 cps NLQ mode printer, to about $800 for a wide-body, 300 cps draft mode, 100 cps NLQ mode printer.

Laser

Excellent appearance, near-typeset quality
Fast--Up to 10 PPM
Graphics
Page description languages (Postscript)
Expensive

A laser printer works much like a copy machine, but instead of inserting the original document, the printer uses a laser beam to produce the printed image. Since there is no hammering contact with the paper as with daisywheel and dot matrix printers, laser printers are usually very quiet. They're also fast, with some models producing up to ten pages per minute. Laser printers also offer very high resolution output, approaching that of a commercial typesetter. Laser printers are partly possible for the growth of desktop publishing, because their output can be flexible enough to include graphics and multiple typestyles in several sizes. Because a typeset page is often complicated due to the graphics and different typestyles, many laser printers use a page description language such as Postscript to control the communication between computer and printer. Laser printers are more expensive than the other types of printers, starting at about $1,000 for a low-end printer without extensive graphics and typestyles, up to about $6,000 for sophisticated models.

Modems

Connect to telephone network

The modem is an electronic device that lets you connect your computer to another computer through the telephone system. The modem may be external, in a small box that connects to the computer through a cable and accepts the telephone wire. Or you may have an internal modem, which fits in an expansion slot inside the computer and accepts the telephone wire.

PC to large computer

Terminal emulation
Database access
Electronic mail

Using a personal computer as a terminal can replace a traditional computer terminal for connection to a large computer. When using the PC as a terminal, the software programs actually run on the large computer. The terminal simply enters data to the large computer and displays results. Using a PC as a terminal usually requires special terminal emulation software, and in some cases, special terminal emulation hardware.

Using a PC to access databases stored on larger computers is a popular activity. In this case, you use commands entered on your PC to search through databases stored on the larger computer. If the search produces the desired results, most communications software provides for capturing the incoming information to a disk file for later editing and printing, or for printing the results directly.

PC to PC

File transfer
Bulletin board
Remote support

PC to PC communications software usually allows for the transfer of files over the telephone system. Remember, and data created and stored in the computer is stored as a file on the disk, so you can send anything you create to another PC user, if both are equipped with modems.

Bulletin board systems callers read and leave messages, and upload and download files. Bulletin boards are becoming an effective and popular way for employees of a company (or nearly anyone) to keep in touch.

Remote support software lets a technician or expert examine a computer through the modem. For example, if you're having trouble using a software program, instead of communicating with the expert by voice, attempting to describe the problem, the expert could see your software on the calling computer. The expert could issue commands to look at more data, and could transmit commands to fix the problem.

Speed

Measured in bits per second (baud)
1200 BPS
2400 BPS most common
9600 BPS

The speed at which a modem can transmit and receive data is the major feature of the modem. 2400 bps modems are the most popular, and can transmit about ten kilobytes of data per minute. Faster modems, of course, are more expensive, but are cost effective when sending data long distance.

Functions of DOS

"First breath of life"

Master supervisor or control program
Allows applications programs (word processing, spreadsheet, database) to run

DOS is the most fundamental software program your computer uses; you'll have to use DOS before you get the chance to use software like Lotus 1-2-3 or WordPerfect. DOS is called a systems program, as opposed to applications programs like spreadsheets, word processors, and database programs.

Services

Helping applications programs with memory, disks, and peripherals

DOS also provides services to applications programs, although you're not generally aware of this aspect of DOS. For example, when saving a file with Lotus 1-2-3, the 1-2-3 software doesn't actually perform the saving of data to the disk. Instead, 1-2-3 makes a request to DOS, in effect saying "save this information on that disk drive using this name." DOS takes over and does all the work involved in finding space on the disk for the data, and writing the data to disk.

Administrative and utility

Format disks, copy, backup, make directories

Provides a set of utility commands which let you enter the date and time, format diskettes, copy files, and perform other administrative and maintenance tasks. This is the role of DOS that most people are familiar with, and it's these commands that you need to master in order to make effective use of your computer.

Loaded into RAM at startup

From floppy or hard disk
Internal commands always in RAM
External commands remain on disk
Reboot or system reset

DOS, like all computer software, must reside in the computer's RAM memory before it is useful. This process, often called booting the computer, is one of the first tasks your computer performs after you turn it on. If your computer doesn't have a hard disk drive, the computer loads DOS from a diskette in drive A. Otherwise, it loads DOS from the hard disk drive C. DOS remains in the computer's RAM memory until you turn it off or perform a reboot or system reset.

At any time, you can force the computer to perform a reboot or system reset, which means that the computer resets itself, clears the memory, and loads a new copy of DOS from the disk. You perform a reset by holding down the Control and Alternate keys, and pressing Delete (some computers also have a switch or button for this purpose). A reboot is sometimes necessary when the computer freezes or locks up due to an error or bug in a computer program, but generally you don't need to reboot unless a situation like this arises.

DOS command are divided into two classes: internal and external commands. The internal commands are loaded into RAM when the computer loads DOS; therefore, they're always available. External commands remain on the disk and are loaded into RAM memory when needed.

IBM did not develop DOS itself. Instead, IBM licenses DOS from Microsoft. Microsoft's product is called MS DOS; IBM calls it PC DOS. Basically, they are the same. Other compatible computer makers may supply MS DOS with their computers; some others license MS DOS from Microsoft as IBM does but call it Compaq DOS or AT&T DOS. It's the same thing.

History of PC DOS

1.0

Support for original PC

1.1

Support for double-sided diskette drives

The original IBM PC used single-sided floppy diskette drives, meaning that the drive worked with just one side of the diskette. Later, manufacturers introduced double-sided diskettes, which doubled the capacity of a disk. But the existing version of DOS didn't know how to work a double-sided drive, so a new version of DOS was needed.

2.0

Support for PC XT and hard disk drives
Tree-structured directories
More Unix-like

Version 2.0 of PC DOS included support of a hard disk drive, as well as the various commands needed to effectively use the hard drive--the commands to use subdirectories and the backup and restore commands. Later, IBM introduced version 2.1, which included minor revisions for the PC Portable and PC Junior.

3.0, 3.1

Support for PC AT, larger hard disk drives, and high-capacity (1.2 MB) floppy diskette
Network support

Version 3.0 supported the 80286 processor found in the AT, the 1.2 MB high-density floppy diskettes, and large capacity hard disks. Version 3.1 supported the IBM PC Network.

3.2

Support for PC convertible
3.5", 720 KB diskette drives

Version 3.2 made it possible to use the 3.5 inch, 720 KB floppy diskette drives on an IBM PC.

3.3

Personal System 2 support

Version 3.3 is necessary to support the PS/2 line of computers from IBM.

4.0, 4.01

Version 4 of DOS provides support for disk volumes greater than 32 MB. Previously, most version of DOS support a maximum drive size of 32 MB. A user of a 40 MB drive, then, must partition the drive into two or more smaller volumes, perhaps a drive C of 32 MB and a drive D of 8 MB. DOS 4, however, can make the entire disk, even hundreds of megabytes in size, be drive C. Also, version 4 contains a shell program that provides a menu for running programs and performing DOS file commands.

OS/2

Multitasking
Advanced features of 80286 and 80386 processors

OS/2 is the newest operating system from IBM and Microsoft. It's not an upgrade in the sense that DOS 3.3 is like DOS 3.2 with a few new features. Instead, OS/2 is a separate operating system that offers many new features. OS/2 requires a PC with 80286 or 80386 processor, hard drive, and at least 1.5 MB memory. OS/2 operates in the 80286 and 80386 processor's protected mode, meaning that it can address up to 16 MB of RAM memory. OS/2 implements virtual memory, which is a way of simulating more memory than the computer actually has through disk swapping. OS/2 also offers multitasking execution of programs, meaning that multiple programs can be running at the same time.

Classic DOS applications are not compatible with OS/2, although OS/2 does offer a compatibility box that will run most classic DOS applications. The compatibility box, however, does not support OS/2's advanced features. Software publishers that intend to sell OS/2 version of their products must rewrite them, often from the beginning.

It's estimated that the classic DOS versions will continue to outsell OS/2 for quite some time. One forecast calls for 235,000 copies of OS/2 to be sold in 1988, while 3,300,000 copies of classic DOS will be sold in 1988. In general, the future of OS/2 is secure, but it may never become more popular than DOS.

Microsoft Windows

Windows is not, strictly speaking, an operating system, but instead is an enhancement to DOS that provides a variety of features. The latest version of Windows, version 3.0, offers significant features such as a common graphical user interface, access to expanded and extended memory, multitasking, data exchange, printer and display support, and other features. While nearly any DOS program will run under control of Windows, Windows computing is most effective when using programs designed especially for Windows 3.0. Currently, software publishers like WordPerfect Corporation and Lotus are racing to develop version of their DOS programs for Windows.

It appears that Windows 3.0 is a very powerful force in computing and will continue to grow as a factor. Windows 3.0 runs on any computer with 640 KB memory and a hard disk drive. As a practical matter, you'll want an 80386-based computer with at least two MB memory to make effective use of Windows 3.0 and its applications.

DOS Prompt

Finished with last task, ready for new command

It's the appearance of the DOS prompt that indicates the previous command is finished, and that you can type another command.

Default disk drive

A>
B>
C>

The default disk drive means that if you tell DOS to perform a command involving a disk drive, and you don't specify in that command which disk drive to work with, DOS works with the default drive as the prompt indicates. Much of the time this rule of the default saves time and effort, but it can occasionally cause confusion or harm.

Changing the default disk drive

Type the name of the new default drive.

Changing the default disk drive is useful when you want to perform several commands involving a disk drive other than the default. Changing the default in this case will make the command easier to type, and less likely to contain errors. To change the default disk drive, type the name of the disk drive that you'd like to make the default drive. If A> is showing, typing c: and pressing the Enter key produces C>.

Changing the prompt

Produces more informative prompt
C>prompt $p$g
C:\
C:\LOTUS>

The prompt command has many options that let you customize the plain prompt that DOS normally supplies. The above command, prompt $p$g, produces a prompt that shows not only the default disk drive, but also shows the current directory of the disk.

Format Command

Initializes disk for use on IBM PC

Writes tracks and sectors on disk
Erases (irretrievably) all data on disk

A disk, floppy or hard, is organized into tracks and sectors. Tracks are concentric circles on the disk, somewhat similar to the groove on a phonograph record. Sectors are portions of a track. The IBM PC and XT floppy diskettes use nine sectors per track. The format command's job is to lay down the tracks and sectors on the disk. Later, programs like Lotus 1-2-3 will fill the tracks and sectors with their data. Until the disk is formatted, it can't be used, so it's an essential first step, and usually performed just once on each disk.

Erasing data is a by-product of the format command that can sometimes lead to lost data. It's important to understand the format command to ensure that you always format the correct disk.

Quality control check

As the format command performs its work, it tests the disk surface. If it finds defects, it marks that part of the disk as a bad track or sector, and will not use that part of the disk for data storage. At the end of the command, format reports if it found bad tracks and sectors.

Hard drive computer procedure

Place disk to format in drive A
C>format a:

Since most hard disk drives have had all the DOS program files copied to them, DOS finds the program file format.com on the hard drive. No DOS diskette is necessary.

Dangers and precautions

The most dangerous aspect of the format command is that it erases the data on the disk as it formats. Combined with the principle of the default disk drive, this can lead to inadvertently formatting the wrong disk. For example, suppose you type this: C>format. In this case, the default disk drive is C, the hard drive. Since you didn't specify which disk drive to format, DOS assumes you want to format the default drive, and DOS will start to format the hard disk drive. Actually, this mistake is not that easy to make, as DOS recognizes that the data on the hard drive will be lost and asks for confirmation before formatting. Still, some people format their hard drives by mistake--a good example of why you need regular backups of the hard drive.

Options

C:\>format a: /s (produces bootable system disk)
C:\>format a: /v (adds volume label)
C:\>format a: /4 (formats for 360 KB in a 1.2 MB drive)
C:\>format a: /n:9 /t:80 (formats for 720 KB in a 1.44 MB drive)

Options to the format command cause it to behave in different ways. The /s command copies the essential DOS system files to the formatted disk, thus creating a disk that you can use to boot the computer from. This is not done very often, as most people boot the computer from the hard disk drive, and making a system disk reduces the capacity of the disk.

The /v option lets you add a volume label to the disk. The DOS label command lets you do this, too. Version 4 of DOS asks for the volume label even when formatting without this option.

The /4 option is important for those using IBM AT and compatible computers with the 5.25" high-density disk drive. If you place a double-density disk (a disk designed to hold just 360 KB of data) in the drive and format it, DOS will try to format it to hold 1.2 MB. As you can imagine, the format will not work very well. Using the /4 option instructs DOS to format the disk to hold 360 KB, and the format will work. As mentioned before, however, these diskettes are not guaranteed to be readable in older, 360 KB diskette drives.

Users of DOS 4.00 and above can use the /f option to specify the disk capacity when formatting. The two most common format commands with this option are:

C:\>format a: /f:360
C:\>format a: /f:720

The first command formats a double-side, double-density (360K) disk in a high-capacity, AT-style drive. The second formats a double-sided, double-density (720K) disk in a high-capacity drive.

Files

All data on the disk is stored in a file

In this sense, the file is a logical unit of organization of the disk. Of course, the disk is physically organized as tracks and sectors, but you're never aware of what track or sector a file is stored in, just the name under which it is stored.

Spreadsheet file
Word processing document file
Database file

Generally, with most programs, each time you create a new spreadsheet, word processing document, or database, and save it to the disk, you've created a new file on the disk.

File Names

"Root" name
Eight characters maximum length
Alphabet characters (capitalization doesn't matter)
Digits 0 Through 9
$ & # @ ! % ' ` ( ) - _ { }
No spaces!

Since the rules for which punctuation characters may be used is highly arbitrary, a simple rule to remember is use just the letters of the alphabet and the digits. You'll sacrifice some flexibility in naming your files, but the rule is easier to remember. Why can't you use spaces? Because in DOS commands, spaces are used to separate one file from another, and if a file has a space in its name, DOS thinks you typed two file names.

Also, many programs restrict the allowable file name characters. For example, in dBASE III Plus, a database file name must start with a letter, and can contain letters, digits, and the underscore--but nothing else. This information comes from each program's manual, which is always a valuable resource.

Extension (optional)
Three characters maximum length
Same allowable characters as the root name
Separated from root name by a period
Often used to indicate file type

.BAS BASIC language program
.COM, .EXE Executable computer program
.BAT DOS batch file
.WKS, .WK1, WK3 Lotus 1-2-3 worksheet
.DBF dBASE III Plus or dBASE IV database
.DOC Microsoft Word document file

The use of the extension as a type indicator is very valuable, providing the ability to work with groups of files with single commands. Most programs automatically add their extension to whatever name you supply. There are exceptions. WordPerfect, for example, doesn't automatically add an extension, so you're free to add your own, or not use one at all.

Directories

Directories organize a hard disk drive

Since a hard drive's tremendous capacity lets you create hundreds or even thousands of files, it's necessary to subdivide the disk into more conveniently manageable units. These organizational units are directories, sometimes called subdirectories. When you have created directories you can change to one of the directories, and DOS "sees" only the files contained in that directory. Even if thousands of files exist in other directories, you can work with just those files in the current directory that you changed to. For example, typing erase *.* will erase only those files in the current directory. In many ways, it's as though each directory was a separate disk drive.

Hierarchical structure

The directories on a disk are organized hierarchically, with one directory at the top of the directory structure, called the root directory. (This directory, called "root" when spoken, is typed as the \ [backslash] character on the keyboard.) All other directories are below or subordinate to the root directory--thus the term subdirectory. DOS creates the root directory automatically when you format a disk.

Organized by software program, function, or other scheme

When you decide to use directories, you need to make your own directory structure with the make directory command. Many people create a directory for each program they use, perhaps one for their Lotus 1-2-3 work, a second directory for dBASE III Plus, and a third for Microsoft Word. Others create directories along project or function lines, perhaps a directory for work relating to budgets (which could contain Lotus worksheets, dBASE databases, and word processing files) and another for proposal files of all types.

|----- home
|
|----- lotus -----|----- work
| |
| |----- school
\ --------|----- dbase
| |----- home
| |
|----- word -----|----- work
|
|----- school

Paths

Each directory is identified by its path, which is a listing of all directory names you have to traverse to get to the desired directory.

\lotus

This path starts at the root directory (the \ character) and then proceeds to the directory called lotus within the root directory.

\lotus\home

This path starts at the root directory, proceeds to the lotus directory, and then proceeds to the home directory within the lotus directory. Note that this command uses two \ characters. The first one means start at the root directory, while the second \ serves to separate the name lotus from the name home. Thus, the same character has two different meanings in the same command.

\lotus\home\budget.wk1

This represents a file called budget.wk1 located in the \lotus\home directory. Notice that the backslash character also serves to separate the file name from its directory name.

c:\lotus\home\budget.wk1

This represents the most complete specification of a file. It specifies the disk drive name, the path to the directory that the file is located within, and the name of the file. Since this file name includes all these items, it is completely unambiguous.

Working With Directories

Once you've created directories, you need to know how to reference a file in a directory when using DOS commands like copy and erase.

Change to the directory

Once you change to a directory, you can reference or access files just as if there were no directories.

C:\>cd \lotus
C:\LOTUS>copy budget.wk1 a:

These two commands copy a file called budget.wk1 that was located in the \lotus directory to disk drive A. The first command makes the \lotus directory the current directory. (Note that the enhanced DOS prompt changes to show the path of the current directory.) Then, the second command makes the copy. Note that the second command makes no reference to the \lotus directory at all, and in fact, it ignores the fact that there are subdirectories on the disk. It illustrates that once you change to the right directory, it's almost as if there weren't any directories at all.

C:\>copy \lotus\budget.wk1 a:

In this command, we prefix the name of the file (budget.wk1) with the path to the directory the file is located in (\lotus). This means that this command works no matter which directory is the current directory, while the simple command copy budget.wk1 a: requires that you change to the \lotus directory first. Notice that this command uses two \ characters. The first one means start the path at the root directory, while the second serves as a separator character between the name of the directory lotus and the name of the file budget.wk1.

C:\>cd \lotus
C:\LOTUS>copy budget.wk1 \word

These two commands copy the file budget.wk1 from the \lotus directory to the \word directory. The first command, as we've seen, makes the \lotus directory current. The second command copies the file budget.wk1 from the current directory to the word directory. This shows that instead of using a disk drive name such as a: for the target of a copy, you can use a path to a directory as the target.

C:\>cd \word
C:\WORD>copy a:*.doc

These commands copy all the Microsoft Word files (they end with the extension .doc) from drive A to the \word directory on drive C. The first command, of course, makes the \word directory the current directory. The second command uses the file specification a:*.doc as the source of the copy, which means all files on drive A with the extension .doc. What is the target of the copy? Since we left it blank, the target becomes the current directory of the default drive, which is c:\word.

As a more comprehensive example, suppose that in the c:\lotus directory there is a file called budget.wk1. Your goal is to copy it to the c:\word directory. Also, suppose that the current directory is c:\lotus. This command will perform the copy:

C:\LOTUS>copy budget.wk1 \word

Since the file budget.wk1 is in the current directory, we can reference it directly without a directory or drive prefix. Suppose the current directory is c:\word. You'd need this command:

C:\WORD>copy \lotus\budget.wk1

In this case, we have to prefix the name of the source file with the directory it's located in. We can leave the target of the copy blank, because the current directory is the target directory. Now, suppose that the current directory is neither the source or target:

C:\>copy \lotus\budget.wk1 \word

In this case, we must specify both the source and target directories. This command is a combination of the two previous commands. Finally, suppose that the current directory is a disk other than C:

A:\>copy c:\lotus\budget.wk1 c:\word

Here, we must add the disk drive identifier to the previous command. This command will work at all times, no matter what the current drive and directory is. The preceding commands make use of knowledge about the current drive and directory to shorten the command.

We've seen how to use the copy command to place files in directories. How else do files get in a certain directory? Nearly all software programs have a provision for placing their files in the desired directory. For example, in Lotus 1-2-3, when you save a file you can type a directory name before it, as in \lotus\home\budget, which would save the worksheet with the name budget, but in the \lotus\home directory. Alternatively, you could have used the File Directory command in 1-2-3 to change 1-2-3's current directory to \lotus\home. Then if you save the worksheet with the simple name budget, it's placed in the \lotus\home directory. (You can use the Worksheet Global Default Directory Update command to make this change permanent.) The equivalent command in Microsoft Word, for example, is Transfer Options.

Make Directory Command

Creates a Directory

Before you can work with directories, you must create them

C:\>md \lotus

This command makes a directory called \lotus underneath the \ (root) directory.

C:\>md \lotus\home

This command makes a directory called home underneath the \lotus directory.

|----- home
|
|----- lotus -----|----- work
| |
| |----- school
\ --------|----- dbase
| |----- home
| |
|----- word -----|----- work
|
|----- school

C:\>md \lotus
C:\>md \dbase
C:\>md word

The last command illustrates that you don't always need to use the \ character when naming directories. If you do use \, the new directory will be created directly below the root directory. If you don't use \ to start the name, the new directory is created in whichever directory was current when you issued the md command.

C:\>md \lotus\home
C:\>md \lotus\work

These two commands created new directories underneath or within the \lotus directory, called \lotus\home and \lotus\work.

C:\>cd \lotus
C:\>md school

These two commands create a new directory called \lotus\school. Note that since we used the cd (change directory) command to first change to the \lotus directory, it wasn't necessary to type anything besides the directory name school. If we had typed md \lotus\school, the command would have worked, of course, but that command supplies unnecessary, though harmless, information. If we had typed md \school, DOS would have created a directory called \school. This directory is located immediately below the root directory, instead of within the \lotus directory.

Exercise

Create this directory structure on the hard drive C:

|----- ss
|
|
\ --------|----- db
|
|
|----- wp

Change Directory Command

Changes to a directory

Once you change to a directory, you can access the files within that directory easily. Also, before you can run many computer programs, you must first change to the directory where that program is located.

C:\LOTUS>cd \

This command changes to the \ (root) directory.

C:\>cd \lotus

This command changes to the \lotus directory.

C:\>cd lotus

This command changes to the \lotus directory, if currently in the \ (root) directory. You must be within the root directory for this command to work, because that's where the \lotus directory is. If you're in the \word directory and you enter this command, it means to try to change to a directory called lotus that's contained within the \word directory (in other words, the directory \word\lotus). Since there is no such directory, the command fails, and DOS displays an error message.

C:\>cd \lotus\home

This command changes to the \lotus\home directory.

C:\LOTUS>cd home

This command changes to the \lotus\home directory, if currently within the \lotus directory. If you're not in the \lotus directory, say the root directory, this command won't work. That's because there is no directory in the root directory called home, and typing a directory name without the \ character means to find that directory within the current directory. If it isn't found, the command fails and DOS reports an error message.

Remove Directory Command

Removes a Directory

Procedure

First, erase all files from the directory. The . and .. directories remain, as they can't be erased. Second, you must change to a different directory than the one you want to remove. Finally, issue the rd command.

DOS, as a safety measure, won't let you remove a directory until all the files in it are deleted. The two special housekeeping files, . and .., can't be erased, but the directory is considered empty if only those files remain. Also, you must change to a directory other than the one you plan to remove. DOS, in other words, won't let you pull the rug from under your own feet and remove the current directory.

C:\>rd \lotus

This command removes the \lotus directory. Once you've taken care of the above steps, you can use the rd command to remove the directory. At this time, the directory is gone, and it doesn't appear in the directory listing.

Directory (dir) Command

Displays list of files

The directory command produces five columns of information. The first column is the root name of the file. The second column is the file's extension, if it has one. Next, DOS displays the file's size in bytes. Finally, DOS shows the date and time the file was last saved or modified. At the end of the listing, DOS shows the number of files on disk and the free disk space remaining.

C:\>dir

This command displays the directory of drive C (the default drive). Here, since we didn't specify which disk to take the directory of, DOS looked at the default drive. If DOS is displaying the C:\> prompt, typing dir produces the list of files on drive C, the hard disk drive.

C:\>dir a:

Displays directory of drive A. In this case, we specified a disk drive for the directory command to work with, so we get a list of files on drive A.

C:\>dir command.com

This command displays directory information for the file command.com (if it exists on drive C). If the dir command doesn't find the specified file, it reports "File Not Found."

C:\>dir a:command.com

Displays directory information for the file command.com (if it exists on drive A). Adding a disk drive name as a prefix to a file name forces DOS to work with that disk drive, rather than working with the default disk drive.

Options

C:\>dir /p
C:\>dir /w

These two command options are necessary because unlike a word processing or spreadsheet program, the dir command doesn't let you press the Page Up key to see previous screens of files. Using the /p option shows the same information as the regular dir command, but one screen at a time. The /w option shows just the filename and extension.

The dir command also works with the wildcard file name characters. To view all the Lotus 1-2-3 worksheets on a disk, type dir *.wk1. To use these options with a file name, remember to type the command options last. For example:

C:\>dir *.wk1 /p

This command displays all the Lotus 1-2-3 worksheet files, pausing after each screen.

Copy Command

Copies a file or group of files

Copy <source> <target>

In the general format of a computer command, words in the <> characters mean that you replace that word with the actual value you want to use. In the copy command, then, you type the word copy, a space, the name of the file to copy from (the source of the copy), a space, and the name of the disk drive or file to copy to (the target of the copy).

C:\>copy command.com a:

This command copies the file command.com from drive C to drive B, retaining the same name. When the target of a copy is just the name of a disk drive or directory, the resulting copy of the file on the target disk has the same name as the source file.

C:\>copy command.com bill.com

This command copies the file command.com from drive C to drive C, with the new name bill.com. This form of the copy command is not commonly used, but it illustrates the meaning of the source of the copy and the target. Why is the file bill.com created on disk drive C? Because drive C is the default drive (because of the C:\> prompt), and the command mentions nothing about any other disk drive, so DOS uses the default drive.

C:\>copy command.com a:bill.com

This command copies the file command.com from drive C to drive A, with the new name bill.com. Again, an uncommon example, but it shows how you can add a disk drive identifier to a file name to force it to a different disk drive than the default.

C:\>copy a:command.com c:

This command copies the file command.com from drive A to drive C, retaining the same name. This copy command illustrates that DOS can copy from any disk to any other disk.

C:\>copy a:command.com

This command copies the file command.com from drive A to drive C, retaining the same name. The difference between this command and the preceding command is that we omitted the target of the copy. In this case, the rule of the default applies, and the target becomes drive C because of the C:\> prompt.

Copying Over Existing Files

What if the file being copied already exists on the target drive? Since file names must be unique, DOS can't place two copies of the file on the disk in the same directory. Instead, DOS first erases the file from the target disk, and then makes the copy. This is the only time that the copy command will erase a file to make room for a copy--when copying a file with the same name as one on the target disk. Otherwise, if the target disk doesn't have enough room for the incoming file, copy reports "Insufficient Disk Space" and halts the copy command.

Be careful with the copy command, as it can lead to loss of data as DOS deletes an existing file to make way for a file being copied with the same name. Typically, when copying a file to a disk for the second time, you're copying a new version over an old version. In this case, you do want the copy command to delete the existing, older version of the file. But if you mistakenly copy the old version to a disk or directory containing a newer version of the file, you'll lose the new version and retain just the old version. You'll lose the changes you made to the new version.

Global File Names

DOS provides two special characters, called wild card or global characters, which make it easy to manipulate groups of files with a single command.

? (Question Mark)

The question mark matches any single character. Budget?.wk1 matches budget1.wk1, budget2.wk1, and budgetx.wk1

* (Asterisk)

The asterisk matches any number of any characters. Budget.* matches budget.wk1, budget.dbf, budget.doc, and budget.bas. *.wk1 matches budget.wk1, project.wk1, bill.wk1, and susan.wk1. *.* matches all files.

C:\>copy *.wk1 a:

This command copies all files with the extension .wk1 (these are Lotus 1-2-3 release 2 worksheets) to drive A, retaining the same names.

C:\>copy *.* a:

This command copies all files from drive C to drive A, retaining the same names.

C:\>copy *.* a

The target of this copy command (the letter a) looks like a disk drive name, but since it isn't followed by a colon, it's interpreted as a file name. In this case, the file's name is a located on drive C. Each of the files on drive C is copied to this file, with each new file being copied replacing the existing file. Therefore, after the copy command is complete, the file called a on drive C is identical to the last file copied. Be careful with this--if your goal is to copy files to the floppy disk drive and then delete them from drive C, you could lose some data.

Most programs supply their own file name extensions: .wks for Lotus 1-2-3 Release 1A, .wk1 for Lotus 1-2-3 Release 2 and 2.2, .wk3 for Lotus 1-2-3 Release 3, .doc for both Microsoft Word and MultiMate, .dbf for a dBASE III Plus or dBASE IV database file, .com and .exe for executable computer program files, and .bat for DOS batch files. By using these file extensions along with the or global characters, it's easy to manipulate groups of files with a single command.

Other DOS commands that work with global file names include the directory command, as in dir *.wk1, which lists all the Lotus 1-2-3 worksheets, and the delete command, as in del *.wk1, which deletes all the Lotus 1-2-3 worksheets.

Erase or Del Command

Erase files and frees disk space

The space formerly occupied by the erased file is considered unused space on the disk, and other files will use its space.

C:\>erase budget.wk1

This command erases the file budget.wk1 from drive C, the default disk drive. In this command, we didn't indicate which disk drive to erase the file from, so DOS looked for it on the default drive (C, because the prompt is C:\>).

C:\>erase a:budget.wk1

This command erases the file budget.wk1 from drive A. In this command, we added the disk drive name to the file, so the command looks to that disk drive for the file to erase.

C:\>erase *.wk1

This command erases all files from the default drive C with the extension .wk1. This command illustrates the use of a global file name to erase a group of files with one command. Be careful with a command like this, as it may erase more files than you planned to erase.

C:\>erase a:*.wk1

This command erases all files from drive A with the extension .wk1. This command uses a global file name again, but uses a disk drive name as a prefix to the file name, so the command erases files from drive B.

C:\>erase a:*.*

This command erases all files from drive A (requires confirmation). Again, using a drive name and a global file name to erase all the files from drive B. DOS does force you to confirm that you really want to perform this action.

Also known as del

You can use either word erase or del to perform exactly the same command.

An interesting note is that the erase command doesn't actually erase the data from the surface of the disk in the way that an eraser removes written words from a sheet of paper. Instead, DOS simply marks the file as erased and allocates its space on the disk to the free space on the disk. Until another file overwrites the erased file's data, it is recoverable. DOS doesn't have a command to recover erased files, but many utility software packages (the most famous example is the Norton Utilities) do.

Since the erase command doesn't remove data from the disk, there may be security issues involved in some instances, as files you thought were erase can be recovered and accessed by others. Some utility programs, such as Norton's, include a program to overwrite the erased data with meaningless characters, so that even if someone recovers the file, the original data is gone.

Renaming a File

C:\>rename budget.wk1 budget1.wk1

This command renames the file budget.wk1 on drive C to budget1.wk1 on drive C. The first file name is the name of the old file, and the second name is the new name to use.

Rename does as its name says--it changes the name of the file. The command copy budget.wk1 budget1.wk1 is different, as it creates a new file called budget1.wk1 as does the rename command, but it leaves the original file budget.wk1 alone. After this copy command, then, you'll have two files on the disk with the same contents, but different names. The rename command, though, leaves just one file on the disk, the new file budget1.wk1. The original file, budget.wk1, is gone.

C:\>rename *.txt *.doc

This command renames all files in drive C with the extension .txt to files on drive C with the same root names, but with the extension .doc. This command shows that wild card or global files names work with the rename command.

C:\>rename a:budget.wk1 budget1.wk1

This command renames the file budget.wk1 on the A drive to budget1.wk1 on the A drive. The resulting file, budget1.wk1, is placed on drive A, even though we didn't specify a drive for the new file and the default drive is C. In other words, you can only rename a file on the same disk drive or directory as it already exists--no crossing drives. Also, if the new name already exists, rename displays an error message and doesn't make the name change.

Exercise

Complete these paper exercises by writing down the answers. Your instructor will discuss the answers after everyone completes the questions.

For these questions, assume these facts unless otherwise stated: A floppy diskette in drive A contains Lotus 1-2-3 worksheet files (with the extension .wk1), WordPerfect files (extension .wp), and dBASE database files (extension .dbf). The computer has a hard drive C, and the prompt is C:\>.

1. List all files on drive C, screen-by-screen.

2. List all files on drive A in a wide format.

3. List all the Lotus 1-2-3 worksheet files on drive A, page-by-page.

4. Copy the Lotus 1-2-3 worksheet BUDGET1 from drive A to drive C.

5. Copy the Lotus 1-2-3 worksheet BUDGET1 from drive A to drive C, renaming it 1988B in the process.

6. Copy all WordPerfect documents from drive A to drive C.

7. Correspondence produced for John Doe has the extension .jd. Copy his files from drive A to drive C.

8. There is a series of Lotus 1-2-3 worksheet files on drive A called BUDGET followed by a single numeric digit (BUDGET1, BUDGET2, etc.) Copy all of them from drive A to drive C.

9. Copy all files from drive A to drive C.

10. Rename the Lotus 1-2-3 worksheet file on drive C from 1988B to BUDGET.

11. Delete the Lotus 1-2-3 worksheet file BUDGET on Drive C.

12. Delete all the dBASE database files from drive A.

13. Delete all files from drive A.

14. Whoops, the wrong disk was in drive A for the previous question. What would you do?

15. Change the default disk drive to drive A.

The following questions address subdirectory commands and skills.

16. Copy all the Lotus 1-2-3 worksheet files from drive A to the \ss directory on drive C.

17. Copy all the WordPerfect data files from drive A to the \wp directory of drive C.

18. Copy all the dBASE data files from drive A to the \db directory of drive C.

19. Delete all files from the \db directory and remove it.

20. Create a new directory structure that looks like this:

|---- lotus
|
\ -------- data -- |
|
|---- wp

21. Copy all the files from the \ss directory to the new \data\lotus directory.

22. Copy all the files from the \wp directory to the new \data\wp directory.

23. Remove the old \ss and \wp directories.

Answers to Exercise

For these questions, assume these facts unless otherwise stated: A floppy diskette in drive A contains Lotus 1-2-3 worksheet files (with the extension .wk1), WordPerfect files (extension .wp), and dBASE database files (extension .dbf). The computer has a hard drive C, and the prompt is C:\>.

1. List all files on drive C, screen-by-screen.

C:\>dir /p

2. List all files on drive A in a wide format.

C:\>dir a: /w

3. List all the Lotus 1-2-3 worksheet files on drive A, page-by-page.

C:\>dir a:*.wk1 /p

4. Copy the Lotus 1-2-3 worksheet BUDGET1 from drive A to drive C.

C:\>copy a:budget1.wk1 c:
or
C:\>copy a:budget1.wk1

5. Copy the Lotus 1-2-3 worksheet BUDGET1 from drive A to drive C, renaming it 1988B in the process.

C:\>copy a:budget1.wk1 c:1988b.wk1
or
C:\>copy a:budget1.wk1 1988b.wk1

6. Copy all WordPerfect documents from drive A to drive C.

C:\>copy a:*.wp c:
or
C:\>copy a:*.wp

7. Correspondence produced for John Doe has the extension .jd. Copy his files from drive A to drive C.

C:\>copy a:*.jd c:
or
C:\>copy a:*.jd
or
A:\>copy *.jd c:

8. There is a series of Lotus 1-2-3 worksheet files on drive A called BUDGET followed by a single numeric digit (BUDGET1, BUDGET2, etc.) Copy all of them from drive A to drive C.

C:\>copy a:budget?.wk1 c:
or
C:\>copy a:budget?.wk1

9. Copy all files from drive A to drive C.

C:\>copy a:*.* c:
or
C:\>copy a:*.*

10. Rename the Lotus 1-2-3 worksheet file on drive C from 1988B to BUDGET.

C:\>rename 1988b.wk1 budget.wk1

11. Delete the Lotus 1-2-3 worksheet file BUDGET on Drive C.

C:\>del budget.wk1

12. Delete all the dBASE database files from drive A.

C:\>del a:*.dbf

13. Delete all files from drive A.

C:\>del a:*.*

14. Whoops, the wrong disk was in drive A for the previous question. What would you do?

Search for Norton Utilities or some other such utility software. Don't copy additional files to the disk until you attempt an unerase.

15. Change the default disk drive to drive A.

C:\>a:

16. Copy all the Lotus 1-2-3 worksheet files from drive A to the \ss directory on drive C.

C:\>cd \ss
C:\SS>copy a:*.wk1
or
C:\>copy a:*.wk1 \ss

17. Copy all the WordPerfect data files from drive A to the \wp directory of drive C.

C:\>cd \wp
C:\WP>copy a:*.wp
or
C:\>copy a:*.wp \wp

18. Copy all the dBASE data files from drive A to the \db directory of drive C.

C:\>cd \db
C:\DB>copy a:*.dbf
or
C:\>copy a:*.dbf \db

19. Delete all files from the \db directory and remove it.

C:\>cd \db
C:\DB>del *.*
C:\DB>cd \
C:\>rd \db
or
C:\>del \db
C:\>rd \db

20. Create a new directory structure that looks like this:

|---- lotus
|
\ -------- data -- |
|
|---- wp

C:\>md \data
C:\>md \data\lotus
c:\>md \data\wp

21. Copy all the files from the \ss directory to the new \data\lotus directory.

C:\>copy \ss\*.* \data\lotus
or
C:\>copy \ss \data\lotus

22. Copy all the files from the \wp directory to the new \data\wp directory.

C:\>copy \wp\*.* \data\wp
or
C:\?copy \wp \data\wp

23. Remove the old \ss and \wp directories.

C:\>del \ss
C:\>rd \ss
C:\>del \wp
C:\>rd \wp