EXIT
Exits the command-line process when the batch file terminates
BREAK
When turned on, batch file will stop if the user presses < Ctrl >-< Break > when turned off, the will continue until done.
CALL
Calls another batch file and then returns control to the first when done.
CALL C:\WINDOWS\NEW_BATCHFILE.BAT |
Call another program
Details.
CHOICE
Allows user input. Default is Y or N.
You may make your own choice with the /C: switch. This batch file s a menu of three options. Entering 1, 2 or 3 will a different row of symbols. Take note that the IF ERRORLEVEL statements must be listed in the reverse order of the selection. CHOICE is not recognized in some versions of NT.
@ECHO OFF ECHO 1 - Stars ECHO 2 - Dollar Signs ECHO 3 - Crosses
CHOICE /C:123
IF errorlevel 3 goto CRS IF errorlevel 2 goto DLR IF errorlevel 1 goto STR
:STR ECHO ******************* ECHO. PAUSE CLS EXIT
:DLR ECHO $$$$$$$$$$$$$$$$$$$$ ECHO. PAUSE CLS EXIT
:CRS ECHO +++++++++++++++++++++ ECHO. PAUSE CLS EXIT
|
FOR...IN...DO
Runs a specified command for each file in a set of files. FOR %%dosvar IN (set of items) DO command or command strcuture.
%%dosvar is the variable that will hold items in the list, usually a single leter: %%a or %%b. Case sensitive, %%a is different from %A. The items in the (set) are assigned to this variable each time the loop runs.
(set of items) is one item or multiple items seperated by commas that determine how many times the loop runs.
command or command strcuture is the operation you want to perform for each item in the list.
This code will run through the set (A, B, C), when it gets to B it will print the message: "B is in the set!"
FOR %%b in (A, B, C) DO IF %%b == B echo B is in the set! |
This line will print the contents of C:\windows\desktop
FOR %%c in (C:\windows\desktop\*.*) DO echo %%c |
So, you may create your own list or use various s like files to determine the loop run.
Details.