联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!
@echo off call 另一个.bat hello
@echo off echo %1 pause
@echo off call 2.bat call :a pause
@echo off %* goto :eof :a echo aaaaaaaaa goto :eof :b echo bbbbbbbbb goto :eof
@echo off :: main entry set "func=%~1" shift goto %func% goto:EOF :: functions definitions show below :bannerPingPong varref -- moves text in varref one step left or right and updates title :: -- varref [in,out] - variable name with banner text, format: "Banner Text------" SETLOCAL ENABLEDELAYEDEXPANSION set s=!%~1: =-! if "!s:~-1!" NEQ "-" if "!s:~-1!" NEQ "+" set s=!s!-------- set d=!s:~-1! if "!s:~0,1!" NEQ "-" set d=+ if "!s:~-2,1!" NEQ "-" set d=- if "!d!"=="+" (set s=-!s:~0,-2!+) ELSE (set s=!s:~1,-1!--) TITLE !s! (ENDLOCAL & REM RETURN VALUES IF "%~1" NEQ "" SET %~1=%s% ) goto:EOF
@echo off set "text=hi -" for /l %%C in (1,1,15) do ( call func_lib.bat :bannerPingPong text call echo.'%%text%%' )