home *** CD-ROM | disk | FTP | other *** search
-
- @rem test2.bat
- @rem #1
- @rem This program illustrates working with
- @rem variables, arguments, and decisions.
-
- @cls
- @rem #2
- @set %message=You followed test2 with
- @echo============================================
-
-
- @rem #3
- @if "%1"=="" ( @rem conditional statement
- @echo You must enter an argument of
- @echo 1 or 2 after test2.
- @echo No action will be taken.
- @goto ONE @rem go to the label if no argument
- )
-
- @rem #4
- @echo The argument you typed after test2: %1.
- @if %1 == 1 @echo %message% a 1 (one).
- @if %1 == 2 @echo %message% a 2 (two
-
-
- @echo============================================
-
- :ONE @rem target of label
- pause