Jelena Mamčenko Operating Systems Lecture Notes on Operating Systems 35The parameters may be used in any place in the batch file where a parameter would normally be used as part of the DOS command being run. Markers are used within the batch file to signify which parameter goes where. Markers are comprised of a percent sign (%) and a single digit between 0 and 9 (that's ten markers in use at any one time; remember, zero is a number). As an example: Assume that a batch file named REPEAT.BAT is on the current drive. This file contains two commands: "ECHO OFF" which stops DOS from showing commands and "ECHO %1 %3" where the ECHO command can show messages on the screen. If, at the DOS prompt you typed "REPEAT Red Blue Green" your screen would show "Red Green" as shown in the screen capture: In this simple example, three parameters were passed to the batch file and were placed into the ECHO command in the order received. Only the first and third are shown as only those were referenced in the batch file.
This is the end of the preview.
access the rest of the document.