bat file notes

show information

@echo off

rem string

echo  hello world!

rem set variable

set name=abc

rem show variable

echo %name%

rem set keyboard input

SET /P lname=Enter Last Name: echo %lname%

rem call another bat file

CALL ../xxxx/yyyy.bat

@ECHO OFFREM - LABEL INDICATING THE BEGINNING OF THE DOCUMENT.:BEGINCLSREM - THE BELOW LINE GIVES THE USER 3 CHOICES (DEFINED AFTER /C:)SET /P num=PICK A NUMBER (1, 2, or 3): REM - THE NEXT THREE LINES ARE DIRECTING USER DEPENDING UPON INPUTIF %num%==3 GOTO THREEIF %num%==2 GOTO TWOIF %num%==1 GOTO ONEGOTO END:THREEECHO YOU HAVE PRESSED THREEGOTO END:TWOECHO YOU HAVE PRESSED TWOGOTO END:ONEECHO YOU HAVE PRESSED ONE:END
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章