Advertisement
YOU ARE HERE: LAT HomeCollections

COMPUTER FILE

How to Avoid Accidental Erasures

April 01, 1985|Richard O'Reilly | Richard O'Reilly designs microcomputer applications for The Times.

In the past couple of weeks, two colleagues have accidentally erased the entire contents of the hard-disk storage units on their personal computers, both of which run the MS-DOS (or PC-DOS) operating system.

Both times they had merely intended to format a new floppy disk so that it could be used to store information, a task that must be performed frequently and ought to be foolproof. In each case, though, forgetting to identify the proper disk drive proved fatal.

Before a blank disk can store information, it must be "formatted" to divide it electronically into a series of concentric "tracks" upon which the data can be recorded.

Many different disk formats exist, and they may vary even from computer to computer made by the same manufacturer. It is these differences in electronic disk patterns that prevent you from moving disks freely from one type of computer to another.

Here's where my friends goofed: Instead of typing the command FORMAT A: into their hard disk-equipped computers, they simply typed the command FORMAT and hit the Enter key, a fatal mistake. Here's why.

The FORMAT command erases and reformats the hard disk--unless you have told the computer to run the format program on a different drive.

Fortunately, there's an easy way to prevent accidental erasure of your hard disk. What you have to do is make your computer smart enough to know that you always want to format a disk in Drive A, the name given to the floppy drive on an IBM PC-XT or similar computer. (The hard disk is named Drive C; you always know which drive the computer is using by the prompt on your screen that says A, B or C. The B drive is a second floppy.)

First, you have to give the formatting program--called FORMAT.COM--a new name so that it will not run immediately when you type the command FORMAT. That will free you to use the command FORMAT to run a different program--called FORMAT.BAT--that you will easily create following these instructions.

The new name we're going to use is FORMXZXZ.COM, chosen because it would be very difficult to type accidentally.

You accomplish the name change by typing RENAME FORMAT.COM FORMXZXZ.COM and pressing the Enter key.

Next you have to create three short sets of instructions to tell the computer what to do when you type the command FORMAT. These instructions will be stored as "batch" files, which are simple programs that make your computer carry out a series of steps.

You'll create these files by typing them directly into the computer from the keyboard, exactly as shown. Please ignore any line-width limitation imposed by the newspaper format and press the Enter key only where indicated in parentheses.

You can backspace to correct typing errors on a line before pressing Enter, but if you see a mistake on a previously entered line, just press the F6 key and Enter, and then start over at the beginning because previous lines cannot be edited.

Here's the first file:

COPY CON:FORMAT.BAT (Enter)

ECHO OFF (Enter)

CLS (Enter)

ECHO Type DATADISK and press Enter to create a new data disk in Drive A (Enter)

ECHO or type SYSDISK and press Enter to put the DOS system on the new (Enter)

ECHO disk if you want to be able to start up the computer with it. (Enter)

F6 (Enter)

(Note: This is the F6 key; do not type an F and a 6.)

Some of these commands may be unfamiliar, so let me explain.

COPY CON: followed by a file name tells the computer to put what you type into that file, line by line. (CON is computer jargon for "console" and refers to the keyboard and computer unit.)

ECHO OFF tells the computer not to display on your screen any of the subsequent commands in the file unless specifically told to do so.

CLS clears your screen.

ECHO causes the line it begins to be displayed on the screen.

When you type the F6 key you will see a caret and a Z displayed on the screen, which stands for Control Z and tells the computer to end a file.

Now it's time to type the two batch files that will do the actual work.

Here's one. (Note: Be sure to type the A: at the end of the fourth line of each of these files because that is the part of the command that prevents your hard disk from being erased.)

COPY CON:DATADISK.BAT (Enter)

ECHO OFF (Enter)

CLS (Enter)

FORMXZXZ/V A: (Enter)

F6 (Enter)

And here's the other:

COPY CON:SYSDISK.BAT (Enter)

ECHO OFF (Enter)

CLS (Enter)

FORMXZXZ/V/S A: (Enter)

F6 (Enter)

The only difference between the two versions is that one (SYSDISK) puts the operating system (DOS) on the disk it formats, making it suitable for storing and running programs, while the other (DATADISK) creates only a blank disk. After formatting, both versions let you give the disk a "volume label" of up to 11 letters and/or numbers that will be displayed each time you look at a directory of the disk's contents.

Make sure you've done everything right by looking at a directory of your files with the DIR command. You should not have a file called FORMAT.COM, and you should have four new files called FORMXZXZ.COM, FORMAT.BAT, DATADISK.BAT and SYSDISK.BAT.

Now, if you've done everything right, you can type FORMAT and see the message directing you to type either DATADISK or SYSDISK, depending on which kind of formatting you want.

(Footnote: If you ever purposely want to reformat your hard disk, put a copy of your DOS floppy disk in Drive A and type A:FORMAT.)

Advertisement
Los Angeles Times Articles
|
|
|