Prev | Current Page 356 | Next

John Paul Mueller

"Administering Windows Server 2008 Server Core"

com/batchfiles.html. If you want
to see some very complex examples, including using math within a batch file (something most people
will say you can??™t do) then go to Tom Lavedas??™ Batch File Applications Web site at http://members
.cox.net/tglbatch/.
CREATING BATCH FILES 135
Using the Call Command
You use the Call command to call another location with the current batch file or to start another
batch file. When you want to call another location in the same batch file, you use the label formatting
shown here:
Call :MyLabel
Calling another batch file is similar. You provide the drive, path, and filename of the batch file.
In addition, you can provide command line arguments for the external batch file as shown here:
Call C:\MyBatchFiles\MyBatch.BAT CommandArg1
A call is different from going to another location. When a call completes, the batch file returns
to the calling location and executes the next instruction. In contrast, when you use the Goto command,
the batch file actually transfers control to the new location. The return feature of the Call
command lets you create an advanced programming construct called recursion. Recursion occurs
when a batch file calls itself.


Pages:
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368
traktorki ogrodowe terapia magnetyczna Pompy zatapialne mapa Niemiec Wnętrza Poznań