本帖最后由 okx_cn 于 2020-4-23 21:58 编辑
- @echo off
- echo 批处理练习……
- :: 第一题
-
- for /l %%i in (1,1,100) do (
- set /p=%%i<nul .&& echo %%i
- )
- ::第二题
- for /l %%i in (1,2,100) do echo %%i
- ::第三题
- for %%i in ("bbs bathome.net" ) do echo %%~i
- ::第四题
- for /f "tokens=*" %%i in (text.txt) do echo %%i
- ::第五题
- for /f "tokens=2" %%i in (text.txt) do echo %%i
- pause>nul
复制代码
|