|
1、for in do
@ECHO OFF
ECHO This batch file show how to use the command "FOR……IN……DO"
pause
FOR %%A IN (*.TXT) DO CALL RE.BAT %%A
ECHO PRESS Ctrl+Tab to view
PAUSE
FOR %%A IN (*.TX?) DO REN %%A *.TXT
………………………………………………………………以上为文件for.bat
REN %1 *.TX-
……………………………………………………………以上为re.bat
同时同目录下应该有几个txt文件
如1.txt 2.txt 3.txt
2.简单的菜单系统
@ECHO OFF
echo This batch file show how to creat a menu system
pause
SET PROMP=%PROMPT%>NUL
CLS
REM
ECHO -------------------------1.Creat a back file-------------------------
REM
ECHO -------------------------2.Restore back disk-------------------------
REM
ECHO -------------------------3.Run Diskgen Soft -------------------------
REM
ECHO -------------------------4.Return to dos -------------------------
REM
PROMPT Type the number you want and press ENTER:
……………………………………………………………………以上为菜单主文件menu.bat
同时用1.bat 2.bat 3.bat 4.bat
执行你要的功能
|
|