• Keine Ergebnisse gefunden

FIXDISK ftPE External

Im Dokument ~ Putting sollJtions (Seite 194-200)

MS-DOS Commands

FIXDISK ftPE External

PORR>SEFIXDISK reads -all sectors of the hard disk and displays the number of bad blocks (a block consists of two consecutive sectors).

~ FIXDISK C:

RBIIARKS FIXDISK automatically maps out. (i.e. marks as unusable) any bad sector in an unused portion of the hard disk.

However, FIXDISK does not automatically map out any sector that contains data. To map out a bad used sector, you must choose to "update" the disk in the final FIXDISK prompt.

5-32

FIXDISK requires 15 minutes to execute and displays each block i t reads. If a bad block is found, FIXDISK displays an error message.

FIXDISK completes in 15 minutes, after every sector on disk has been checked. The following prompt displays:

Total of xxx bad blocks found, xxx .ore this pass.

want the disk updated? [y,n]

where "xxx" is the number of bad blocks.

Press Y to update the disk and mark bad sectors, or press R to exit FIXDISK without updating.

Choosing Y marks the bad block(s) in files unusable, and stores the current number of bad blocks on the disk.

Data in the bad sector is no longer usable, and FIXDISK does not indicate which files may contain a bad sector.

Pressing N does not mark bad sectors and does not allow FIXDISK to store the current tally of bad blocks.

DOS Guide MS-DOS ec.mands

FOR

'r!PB Internal

PURPOSE Command used in batch and interactive file processing which allows repeated execution of DOS commands.

SDlrAX FOR %%<c> IN <set> 00 <command> - (batch processing) FOR %<c> IN <set> DO <command> -- (interactive processing) RBIIARKS The FOR command causes DOS to execute <command>

repeatedly for each %%<c> or %<c> listed in <set>. <c>

can be any character except 0 - 9 (to avoid confusion with the %0 - %9 batch parameters).

<set> is (JIIIS:ler (JIIIS:ler) (Jlll!!E)er) ••• )

DOS sets %%<c> or %<c> equal to each member of <set>, then executes the <command> for each member. Wild card characters (* and ?) are allowed i f only one member is listed for <set> (e.g., *.TXT). <Set> cannot exceed 40 characters, including blanks.

Examples of two batch file commands are shown below:

FOR %%f IN (

*. * )

00 DIR %%f

The command above results in an individual directory listing of each file on the disk.

FOR "s III (!'bis is an example.) DO RDI %%s The command above results in the following listing:

lUJI Ifhis RBM is

lUJI an REB eDIIPle.

Only one FOR command can be specified on a single command line in a batch file. Pathnames are not accepted with filenames.

5-33

DOS Guide MS-OOS Conmands switch leaves 322,560 bytes available after formatting.

The /0 switch produces an IBM personal Computer DO~

DOS Guide

GOTO

T!PB Internal

PDRIOSB Command extension used in batch file processing which transfers control to a specified batch file line.

SDr.l'AX GO'l'O <label>

~ GOTO causes commands to be taken from the batch file beginning with the line after the <label> definitio~ A

label in a batch f He is a colon (:) followed by a label name. If no label has been defined, the current batch file terminates, displaying the message Label not found.

GOTO causes the command (s) that immediately follow

<label> to be executed.

For example:

: loop

RBII looping •••

GOTO loop

produces an infinite sequence of messages:

REM looping •••

Starting a line in a batch file with n:n causes the line to be ignored by batch processing. Therefore, although the characters following n:n define a label, they may also be used to insert comments into your file. For example, using the batch setup above, you could type:

:loop This is an infinite loop.

or

: loop

:'fhis is an infinite loop.

None of these statements are displayed on your screen when you run your batch file. They appear only in a listing of your batch file.

5-35

DOS Guide MS-DOS ec.mands HDFORMAT

T!PB External

PURPOSE HDFORMAT formats hard disks for use with MS-DOS.

SDlrAX HDFORMAT

c:

RBRARKS Attache allows the drive reference C: only. If any other drive is referenced or the disk is not ready, HDFORMAT issues the error message You IIU~ specify C: to formatl

5-36

When Drive C is selected, HDFORMAT displays the following message:

CAIJ'l'IDH - BDNNIIE 'l'IIIS PROGRAM WILL PERMANENTLY DESTBOY ALL DATA OR mE DISK! ftPE -C 'l'O ABORT

HDFORMAT destroys all data on the disk and should only be executed during the initial installation of the disk.

Press RETURN to begin formatting the hard disk. I f you erroneously enter HDFORMAT, you can press crRL C to exit the program and return to DOS.

Formatting requires three minutes, during which time Attache displays the following prompt:

waitr formatting •••

HDFORMAT verifies the formatting data on all tracks and displays each track being verified, stopping on the final track, 305. This executes in less than 30 seconds. The following message is then displayed:

VolUJDe label (11 characters, ER'1'ER for none)?

You may either enter a volume label of up to 11 characters for your disk, or press RETURN for no label.

The following message is displayed:

9689088 bytes total disk Spice 9689088 bytes available on disk A>

The disk is configured as Drive C. At each system boot, Drive A is the current logged drive.

DOS Guide

IF

T!PB Internal

PORIOSE Command extension used in batch file processing to allow conditional execution of commands.

SEI!AX IF [NOT] <condition> <command>

~ The IF statement allows conditional execution of commands. When the {condition> is true, the <command> is executed. Otherwise, the <command> is ignored. The parameter <condition> is one of the following:

ERROBLEVEI.. <number>

True only if the previous program executed by COMMAND had an exit code of <number> or higher, where

<number> is a binary value.

<stringl>

==

<string2>

True only i f <stringl> and <string2> are identical.

Strings may not have embedded separators.

£XIS!' <fileDDe>

True only if <filename> exists. Multiple filenames, pathnames, and directories cannot be used for

<filename>, but wild cards are acceptable.

Examples:

IF JI)T £XIS!' ACCrS.Tn' BCBO

can't

fiDel file

This batch file statement displays ·Can't find file" i f ACCTS.TXT is not located in the current directory.

Because pathnames are not allowed in an IF statement, a preceding CHOIR statement may be required in the batch file. (Batch files always return to their original directory upon termination, regardless of any CHOIR statements they might contain.)

IF BRRORLBVBL 1 LDIK,,;

The batch file containing this command can run after a routine which sets error levels. Any condition except Errorlevel 1 causes LINK to execute.

IF U=ACCTS GO'l'O ACCOORTS

Executing this batch file with ACCTS given as the value to substitute for %1 causes the commands after the label :ACCOUNTS to execute.

5-37

DOS Guide MS-DOS Commands LINK

TYPE External

PURPOSE Compile and link programs.

SYNTAX LINK [<filenames>] [/switches] or LINK @<filespec>

REMARKS The MS-DOS linker program (MS-LINK) is a program that combines separately produced object modules into one relocatable load module (a program you can run); searches library files for definitions of unresolved external references; resolves external cross-references; and produces a listing that shows both the resolution of external references and error messages.

5-38

MS-LINR combines several object files into one relocatable load module, or Run file (called an .EXE or Executable file). As it combines modules, MS-LINR makes sure that all external references between object modules are defined. MS-LINK can search several library files for definitions of any external references that are not defined in the object modules.

MS-LINK also produces a List file that shows external references resolved, and displays any error messages.

MS-LINR uses available memory if possible. When available memory is exhausted, MS-LINK creates a temporary disk file named VM.TMP.

MS-LINK may be started in three ways: you may type commands in response to individual prompts, you may type all commands on the line used to start MS-LINK, or you may create a response file that contains all the necessary commands and tell MS-LINK where that file is when you start MS-LINK.

MS-LINK provides three command characters: the plus sign (+), semicolon (~), and CTRL C.

Details on running MS-LINK, the command characters, switches, and files are in the Programmer's Reference Guide.

Im Dokument ~ Putting sollJtions (Seite 194-200)